[모바일] 왼쪽 푸시 메뉴 > 기술자료 | 해피정닷컴

[모바일] 왼쪽 푸시 메뉴 > 기술자료

본문 바로가기

사이트 내 전체검색

[모바일] 왼쪽 푸시 메뉴 > 기술자료

JavaScript [모바일] 왼쪽 푸시 메뉴

페이지 정보


본문

왼쪽 상단 아이콘을 클릭하면 메뉴가 펼쳐집니다. 모바일 메뉴등에 응용가능합니다.

<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!--<link rel="stylesheet" href="css/bootstrap.leftpush.css">-->
<style>
/*
@import url(http://netdna.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css);
@import url(http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css);
*/
/*-------------------------------*/
/*           VARIABLES           */
/*-------------------------------*/

/**/
body {
  position: relative;
  overflow-x: hidden;
}

body, html {
  height: 100%;
  background-color: #ffffff;
  font-size:1.0em;
}

.nav .open > a { background-color: transparent; }

.nav .open > a:hover { background-color: transparent; }

.nav .open > a:focus { background-color: transparent; }

/*-------------------------------*/
/*           Wrappers            */
/*-------------------------------*/

#wrapper {
  -moz-transition: all 0.5s ease;
  -o-transition: all 0.5s ease;
  -webkit-transition: all 0.5s ease;
  padding-left: 0;
  -webkit-transition: all 0.5s ease;
  transition: all 0.5s ease;
}

#wrapper.toggled { padding-left: 220px; }

#wrapper.toggled #sidebar-wrapper { width: 220px; }

#wrapper.toggled #page-content-wrapper {
  margin-right: -220px;
  position: absolute;
}

#sidebar-wrapper {
  -moz-transition: all 0.5s ease;
  -o-transition: all 0.5s ease;
  -webkit-transition: all 0.5s ease;
  background: #ffffff;
  height: 100%;
  left: 220px;
  margin-left: -220px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-transition: all 0.5s ease;
  transition: all 0.5s ease;
  width: 0;
  z-index: 1000;
}
#sidebar-wrapper::-webkit-scrollbar {
 display: none;
}

#page-content-wrapper {
  padding-top: 70px;
  width: 100%;
}

/*-------------------------------*/
/*     Sidebar nav styles        */
/*-------------------------------*/

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  top: 0;
  width: 220px;
}

.sidebar-nav li {
  display: inline-block;
  line-height: 20px;
  position: relative;
  width: 100%;
  border-bottom:1px solid #dadada;
}

.sidebar-nav li:before {
  -moz-transition: width 0.2s ease-in;
  -ms-transition: width 0.2s ease-in;
  -webkit-transition: width 0.2s ease-in;
  background-color: #1c1c1c;
  content: '';
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  -webkit-transition: width 0.2s ease-in;
  transition: width 0.2s ease-in;
  width: 3px;
  z-index: -1;
}

.sidebar-nav li:first-child a { /* 첫번째 메뉴 */
  background-color: #ffffff;
  color: #000000;
}

.sidebar-nav li:nth-child(2):before { background-color: #ef2a20; }

.sidebar-nav li:nth-child(3):before { background-color: #ef2a20; }

.sidebar-nav li:nth-child(4):before { background-color: #ef2a20; }

.sidebar-nav li:nth-child(5):before { background-color: #ef2a20; }

.sidebar-nav li:nth-child(6):before { background-color: #ef2a20; }

.sidebar-nav li:nth-child(7):before { background-color: #ef2a20; }

.sidebar-nav li:nth-child(8):before { background-color: #ef2a20; }

.sidebar-nav li:nth-child(9):before { background-color: #ef2a20; }

.sidebar-nav li:hover:before {
  -webkit-transition: width 0.2s ease-in;
  transition: width 0.2s ease-in;
  width: 100%;
}

.sidebar-nav li a {
  color: #000000;
  display: block;
  padding: 10px 15px 10px 30px;
  text-decoration: none;
}

.sidebar-nav li.open:hover before {
  -webkit-transition: width 0.2s ease-in;
  transition: width 0.2s ease-in;
  width: 100%;
}

.sidebar-nav .dropdown-menu {
  background-color: #f4f4f4;
  border-radius: 0;
  border: none;
  box-shadow: none;
  margin: 0;
  padding: 0;
  position: relative;
  width: 100%;
}

.sidebar-nav li a:hover, .sidebar-nav li a:active, .sidebar-nav li a:focus, .sidebar-nav li.open a:hover, .sidebar-nav li.open a:active, .sidebar-nav li.open a:focus {
  background-color: #ef2a20;
  color: #ffffff;
  text-decoration: none;
}

.sidebar-nav > .sidebar-brand {
  font-size: 20px;
  height: 65px;
  line-height: 44px;
}

/*-------------------------------*/
/*       Hamburger-Cross         */
/*-------------------------------*/

.hamburger {
  background: transparent;
  border: none;
  display: block;
  height: 32px;
  margin-left: 15px;
  position: fixed;
  top: 20px;
  width: 32px;
  z-index: 999;
  
}

.hamburger:hover { outline: none; }

.hamburger:focus { outline: none; }

.hamburger:active { outline: none; }

.hamburger.is-closed:before {
  -webkit-transform: translate3d(0, 0, 0);
  -webkit-transition: all 0.35s ease-in-out;
  color: #000000;
  content: '';
  display: block;
  font-size: 14px;
  line-height: 32px;
  opacity: 0;
  text-align: center;
  width: 100px;
}

.hamburger.is-closed:hover before {
  -webkit-transform: translate3d(-100px, 0, 0);
  -webkit-transition: all 0.35s ease-in-out;
  display: block;
  opacity: 1;
}

.hamburger.is-closed:hover .hamb-top {
  -webkit-transition: all 0.35s ease-in-out;
  top: 0;
}

.hamburger.is-closed:hover .hamb-bottom {
  -webkit-transition: all 0.35s ease-in-out;
  bottom: 0;
}

.hamburger.is-closed .hamb-top {
  -webkit-transition: all 0.35s ease-in-out;
  background-color: rgba(255, 255, 255, 0.7);
  top: 5px;
}

.hamburger.is-closed .hamb-middle {
  background-color: rgba(255, 255, 255, 0.7);
  margin-top: -2px;
  top: 50%;
}

.hamburger.is-closed .hamb-bottom {
  -webkit-transition: all 0.35s ease-in-out;
  background-color: rgba(255, 255, 255, 0.7);
  bottom: 5px;
}

.hamburger.is-closed .hamb-top, .hamburger.is-closed .hamb-middle, .hamburger.is-closed .hamb-bottom, .hamburger.is-open .hamb-top, .hamburger.is-open .hamb-middle, .hamburger.is-open .hamb-bottom {
  height: 4px;
  left: 0;
  position: absolute;
  width: 100%;
  background-color: #ef2a20;
}

.hamburger.is-open .hamb-top {
  -webkit-transform: rotate(45deg);
  -webkit-transition: -webkit-transform 0.2s cubic-bezier(0.73, 1, 0.28, 0.08);
  background-color: #ef2a20;
  margin-top: -2px;
  top: 50%;
}

.hamburger.is-open .hamb-middle {
  background-color: #ef2a20;
  display: none;
}

.hamburger.is-open .hamb-bottom {
  -webkit-transform: rotate(-45deg);
  -webkit-transition: -webkit-transform 0.2s cubic-bezier(0.73, 1, 0.28, 0.08);
  background-color: #ef2a20;
  margin-top: -2px;
  top: 50%;
}

.hamburger.is-open:before {
  -webkit-transform: translate3d(0, 0, 0);
  -webkit-transition: all 0.35s ease-in-out;
  color: #000000;
  content: '';
  display: block;
  font-size: 14px;
  line-height: 32px;
  opacity: 0;
  text-align: center;
  width: 100px;
}

.hamburger.is-open:hover before {
  -webkit-transform: translate3d(-100px, 0, 0);
  -webkit-transition: all 0.35s ease-in-out;
  display: block;
  opacity: 1;
}

/*-------------------------------*/
/*          Dark Overlay         */
/*-------------------------------*/

.overlay {
  position: fixed;
  display: none;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

/* SOME DEMO STYLES - NOT REQUIRED 

body, html { background-color: #583e7e; }*/

/*body h1, body h2, body h3, body h4 { color: rgba(255, 255, 255, 0.9); }

body p, body blockquote { color: rgba(0, 0, 0, 0.7); }

body a {
  color: rgba(0, 0, 0, 0.8);
  text-decoration: underline;
}*/
</style>

<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script> 
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> 
<script>
$(document).ready(function () {
  var trigger = $('.hamburger'),
      overlay = $('.overlay'),
     isClosed = false;

    trigger.click(function () {
      hamburger_cross();      
    });

    function hamburger_cross() {

      if (isClosed == true) {          
        overlay.hide();
        trigger.removeClass('is-open');
        trigger.addClass('is-closed');
        isClosed = false;
      } else {   
        overlay.show();
        trigger.removeClass('is-closed');
        trigger.addClass('is-open');
        isClosed = true;
      }
  }
  
  $('[data-toggle="offcanvas"]').click(function () {
        $('#wrapper').toggleClass('toggled');
  });  
});
</script>


<div id="wrapper" class="float_layer">
    <div class="overlay"></div>
        
    <!-- Sidebar -->
    <nav class="navbar navbar-inverse navbar-fixed-top" id="sidebar-wrapper" role="navigation">
        <ul class="nav sidebar-nav">
            <li class="sidebar-brand"> <a href="#"> 전체메뉴 </a> </li>
            <li> <a href="index.asp"><i class="fa fa-fw fa-home"></i> Home</a> </li>
            <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-fw fa-folder"></i> 메뉴1 <span class="caret"></span></a> 
                <ul class="dropdown-menu" role="menu">
                    <li class="dropdown-header hidden">Dropdown heading</li>
                    <li><a href="menu11.html">메뉴11</a></li>
                    <li><a href="menu12.html">메뉴12</a></li>
                </ul>
            </li>
            <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-fw fa-medkit"></i> 메뉴2 <span class="caret"></span></a>
                <ul class="dropdown-menu" role="menu">
                    <li class="dropdown-header hidden">Dropdown heading</li>
                    <li><a href="menu21.html">메뉴21</a></li>
                    <li><a href="menu22.html">메뉴22</a></li>
                </ul>
            </li>
            <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-fw fa-file-video-o"></i> 메뉴3 <span class="caret"></span></a>
                <ul class="dropdown-menu" role="menu">
                    <li class="dropdown-header hidden">Dropdown heading</li>
                    <li><a href="menu31.html">메뉴31</a></li>
                    <li><a href="menu32.html">메뉴32</a></li>
                </ul>
            </li>
        </ul>
    </nav>
    <!-- /#sidebar-wrapper --> 
    
    <!-- Page Content -->
    <div id="page-content-wrapper">
        <button type="button" class="hamburger is-closed animated fadeInLeft" data-toggle="offcanvas"> <span class="hamb-top"></span> <span class="hamb-middle"></span> <span class="hamb-bottom"></span> </button>
    </div>
    <!-- /#page-content-wrapper --> 
</div>
<!-- /#wrapper --> 


참고자료
http://www.blueb.co.kr/?c=1/4&cat=메뉴&uid=3960 

댓글목록

등록된 댓글이 없습니다.


Total 2,634건 41 페이지
  • RSS
기술자료 목록
1834
JavaScript   11602  2016-10-18 13:52 ~ 2021-02-19 08:23  
1833
JavaScript   12092  2016-10-11 22:39  
1832
WordPress   10405  2016-10-10 16:28  
1831
영카트   11328  2016-10-10 12:48 ~ 2019-04-14 23:00  
1830
PHP   35030  2016-10-06 22:14 ~ 2018-03-30 14:01  
1829
HTML   13989  2016-10-06 11:49  
1828
제로보드   14723  2016-09-30 16:32 ~ 2022-04-15 19:45  
1827
WordPress   17153  2016-09-30 00:40  
1826
WordPress   9435  2016-09-30 00:28 ~ 2020-08-28 12:11  
1825
호스팅   20289  2016-09-26 23:00 ~ 2017-06-05 00:00  
1824
JavaScript   14928  2016-09-22 08:49 ~ 2021-10-19 18:54  
1823
JavaScript   15340  2016-09-19 19:47  
1822
JavaScript   28012  2016-09-19 18:52  
1821
그누보드   16330  2016-09-12 16:29 ~ 2021-02-26 16:55  
1820
Editor   9765  2016-09-10 11:11  
1819
JavaScript   13417  2016-09-09 02:51  
1818
HTML   14183  2016-09-09 00:58 ~ 2016-09-20 00:00  
열람
JavaScript   17798  2016-09-08 00:17  
1816
JavaScript   13092  2016-09-07 16:25 ~ 2016-09-08 00:00  
1815
그누보드   15849  2016-09-06 12:59 ~ 2022-04-18 15:02  

검색

해피정닷컴 정보

회사소개 회사연혁 협력사 오시는길 서비스 이용약관 개인정보 처리방침

회사명: 해피정닷컴   대표: 정창용   전화: 070-7600-3500   팩스: 042-670-8272
주소: (34368) 대전시 대덕구 대화로 160 대전산업용재유통단지 1동 222호
개인정보보호책임자: 정창용   사업자번호: 119-05-36414
통신판매업신고: 제2024-대전대덕-0405호 [사업자등록확인]  
Copyright 2001~2024 해피정닷컴. All Rights Reserved.