在drawer.min.js

时间:2017-11-01 12:47:08

标签: javascript jquery html css

我正在使用drawer.min.js作为左侧菜单栏。它没有在主菜单中添加子菜单,工作正常。当我添加子菜单时,我无法向下滚动。当我点击菜单外面然后它工作正常。我无法找到问题所在。我已完成了近80%的项目,我不想更改插件。这个问题仍然存在于所有主流浏览器中。

这是我的代码

  
.drawer-open {
	overflow: hidden!important
}
.drawer-nav {
	position: fixed;
	z-index: 2;
	top: 0px;
	overflow: hidden;
	width: 36.25rem;
	height: 100%;
	color: #fff;
	background: rgba(0,0,0,0.9);
}
.drawer-brand {
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 3.75rem;
	display: block;
	padding-right: .75rem;
	padding-left: .75rem;
	text-decoration: none;
	color: #fff
}
.drawer-menu {
	margin: 0;
	list-style: none;
	padding: 20px 30px;
}



.drawer-menu-item {
	display: block;
	text-decoration: none;
	color: #fff;
	font-family: 'AvenirLTStdBook';
	font-size: 19px;
}
.drawer-menu-item:hover {
	text-decoration: underline;
	color: #fff;
	background-color: transparent
}
.drawer-overlay {
	position: fixed;
	z-index: 1;
	top: 0;
	left: 0;
	display: none;
	width: 100%;
	height: 100%;
	/*background-color: rgba(0,0,0,.2)*/
}
.drawer-open .drawer-overlay {
	display: block
}
.drawer--top .drawer-nav {
	top: -100%;
	left: 0;
	width: 100%;
	height: auto;
	max-height: 100%;
	-webkit-transition: top .6s cubic-bezier(.19, 1, .22, 1);
	transition: top .6s cubic-bezier(.19, 1, .22, 1)
}
.drawer--top.drawer-open .drawer-nav {
	top: 0
}
.drawer--top .drawer-hamburger, .drawer--top.drawer-open .drawer-hamburger {
	right: 0
}
.drawer--left .drawer-nav {
	left: -36.25rem;
	-webkit-transition: left .6s cubic-bezier(.19, 1, .22, 1);
	transition: left .6s cubic-bezier(.19, 1, .22, 1)
}
.drawer--left, .drawer--left.drawer-open .drawer-nav, .drawer--left.drawer-open .drawer-navbar .drawer-hamburger {
	left: 0px;
}

.drawer-hamburger {
	left: 160px;
}

.drawer--left.drawer-open .drawer-hamburger {
	left: 36.25rem
}
.drawer--right .drawer-nav {
	right: -36.25rem;
	-webkit-transition: right .6s cubic-bezier(.19, 1, .22, 1);
	transition: right .6s cubic-bezier(.19, 1, .22, 1)
}
.drawer--right .drawer-hamburger, .drawer--right.drawer-open .drawer-nav, .drawer--right.drawer-open .drawer-navbar .drawer-hamburger {
	right: 0
}
.drawer--right.drawer-open .drawer-hamburger {
	right: 36.25rem
}
.drawer-hamburger {
	position: fixed;
	z-index: 4;
	top: 0;
	display: block;
	box-sizing: content-box;
	width: 3rem;
	padding: 0;
	padding: 18px .75rem 30px;
	-webkit-transition: all .6s cubic-bezier(.19, 1, .22, 1);
	transition: all .6s cubic-bezier(.19, 1, .22, 1);
	-webkit-transform: translateZ(0);
	transform: translateZ(0);
	border: 0;
	outline: 0;
	background-color: transparent
}
.drawer-hamburger:hover {
	cursor: pointer;
	background-color: transparent
}
.drawer-hamburger-icon {
	position: relative;
	display: block;
	margin-top: 10px
}
.drawer-hamburger-icon, .drawer-hamburger-icon:after, .drawer-hamburger-icon:before {
	width: 100%;
	height: 3px;
	-webkit-transition: all .6s cubic-bezier(.19, 1, .22, 1);
	transition: all .6s cubic-bezier(.19, 1, .22, 1);
	background-color: #ffffff;
	color: #ffffff;
}
.drawer-hamburger-icon:after, .drawer-hamburger-icon:before {
	position: absolute;
	top: -10px;
	left: 0;
	content: " "
}
.drawer-hamburger-icon:after {
	top: 10px
}
.drawer-open .drawer-hamburger-icon {
	background-color: transparent
}
.drawer-open .drawer-hamburger-icon:after, .drawer-open .drawer-hamburger-icon:before {
	top: 0
}
.drawer-open .drawer-hamburger-icon:before {
	-webkit-transform: rotate(45deg);
	transform: rotate(45deg)
}
.drawer-open .drawer-hamburger-icon:after {
	-webkit-transform: rotate(-45deg);
	transform: rotate(-45deg)
}
.sr-only {
	position: absolute;
	overflow: hidden;
	clip: rect(0,0,0,0);
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0
}
.sr-only-focusable:active, .sr-only-focusable:focus {
	position: static;
	overflow: visible;
	clip: auto;
	width: auto;
	height: auto;
	margin: 0
}
.drawer--sidebar, .drawer--sidebar .drawer-contents {
	background-color: #fff
}

@media (min-width:64em) {
.drawer--sidebar .drawer-hamburger {
	display: none;
	visibility: hidden
}
.drawer--sidebar .drawer-nav {
	display: block;
	-webkit-transform: none;
	transform: none;
	position: fixed;
	width: 12.5rem;
	height: 100%
}
.drawer--sidebar.drawer--left .drawer-nav {
	left: 0;
	border-right: 1px solid #ddd
}
.drawer--sidebar.drawer--left .drawer-contents {
	margin-left: 12.5rem
}
.drawer--sidebar.drawer--right .drawer-nav {
	right: 0;
	border-left: 1px solid #ddd
}
.drawer--sidebar.drawer--right .drawer-contents {
	margin-right: 12.5rem
}
.drawer--sidebar .drawer-container {
	max-width: 48rem
}
}

@media (min-width:75em) {
.drawer--sidebar .drawer-nav {
	width: 36.25rem
}
.drawer--sidebar.drawer--left .drawer-contents {
	margin-left: 36.25rem
}
.drawer--sidebar.drawer--right .drawer-contents {
	margin-right: 36.25rem
}
.drawer--sidebar .drawer-container {
	max-width: 60rem
}
}
.drawer--navbarTopGutter {
	padding-top: 3.75rem
}
.drawer-navbar .drawer-navbar-header {
	border-bottom: 1px solid #ddd;
	background-color: #fff
}
.drawer-navbar {
	z-index: 3;
	top: 0;
	width: 100%
}
.drawer-navbar--fixed {
	position: fixed
}
.drawer-navbar-header {
	position: relative;
	z-index: 3;
	box-sizing: border-box;
	width: 100%;
	height: 3.75rem;
	padding: 0 .75rem;
	text-align: center
}
.drawer-navbar .drawer-brand {
	line-height: 3.75rem;
	display: inline-block;
	padding-top: 0;
	padding-bottom: 0;
	text-decoration: none
}
.drawer-navbar .drawer-brand:hover {
	background-color: transparent
}
.drawer-navbar .drawer-nav {
	padding-top: 3.75rem
}
.drawer-navbar .drawer-menu {
	padding-bottom: 7.5rem
}

@media (min-width:64em) {
.drawer-navbar {
	height: 3.75rem;
	border-bottom: 1px solid #ddd;
	background-color: #fff
}
.drawer-navbar .drawer-navbar-header {
	position: relative;
	display: block;
	float: left;
	width: auto;
	padding: 0;
	border: 0
}
.drawer-navbar .drawer-menu--right {
	float: right
}
.drawer-navbar .drawer-menu li {
	float: left
}
.drawer-navbar .drawer-menu-item {
	line-height: 3.75rem;
	padding-top: 0;
	padding-bottom: 0
}
.drawer-navbar .drawer-hamburger {
	display: none
}
.drawer-navbar .drawer-nav {
	position: relative;
	left: 0;
	overflow: visible;
	width: auto;
	height: 3.75rem;
	padding-top: 0;
	-webkit-transform: translateZ(0);
	transform: translateZ(0)
}
.drawer-navbar .drawer-menu {
	padding: 0
}
.drawer-navbar .drawer-dropdown-menu {
	position: absolute;
	width: 36.25rem;
	border: 1px solid #ddd
}
.drawer-navbar .drawer-dropdown-menu-item {
	padding-left: .75rem
}
}
.drawer-dropdown-menu {
	display: none;
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	padding: 0;
}
.drawer-dropdown-menu>li {
	width: 100%;
	list-style: none
}
.drawer-dropdown-menu-item {
	line-height: 3.75rem;
	display: block;
	padding: 0;
	padding-right: .75rem;
	padding-left: 1.5rem;
	text-decoration: none;
	color: #222
}
.drawer-dropdown-menu-item:hover {
	text-decoration: underline;
	color: #555;
	background-color: transparent
}
.drawer-dropdown.open>.drawer-dropdown-menu {
	display: block
}


.drawer-dropdown span {
	position:relative;
}

.drawer-dropdown span:before {
    content: "+";
    font-family: 'AvenirLTStdBook';
    font-style: normal;
    font-weight: normal;
    text-decoration: inherit;
    color: #fff;
    font-size: 18px;
    padding-right: 0.5em;
    position: absolute;
    top: -20px;
    left: 0px;
}

.drawer-dropdown.open span:before {
	content: "-";
    font-family: 'AvenirLTStdBook';
}

.drawer-container {
	margin-right: auto;
	margin-left: auto
}

@media (min-width:64em) {
.drawer-container {
	max-width: 60rem
}
}

@media (min-width:75em) {
.drawer-container {
	max-width: 70rem
}
}





.drawer-menu li a {
	display: block;
	text-decoration: none;
	color: #fff;
	font-family: 'AvenirLTStdBook';
	font-size: 16px;
	text-transform: uppercase;
	line-height: 60px;
	font-weight: normal;
	letter-spacing: 2px;
}

.drawer-menu li a img {
	padding-right:15px;
}

.drawer-brand {
	color: #fff !important;
	font-family: 'AvenirLTStdMedium';
	font-size: 22px !important;
	line-height: 50px !important;
}

.drawer-brand img {
	padding-right:8px;
}


.drawer-dropdown-menu li {
	margin-left:50px;
	position:relative;
	padding-left:10px;
}

.drawer-dropdown-menu li:before {
	content:'';
	position:absolute;
	left:0;
	width:4px;
	height:4px;
	border-radius:50%;
	background:#02a6e7;
	top:10px;
}

.drawer-dropdown-menu li a {
	font-size:12px;
	line-height:26px;
	text-transform:uppercase;
	transition:all 0.4s;
}


.drawer-dropdown-menu li a:hover {
	color:#ccc !important;
	transition:all 0.4s;
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/font-awesome.css">
<link href="css/drawer.min.css" rel="stylesheet">
<title>test</title>
</head>

<body class="drawer drawer--left">

<div role="banner">
   
    <nav class="drawer-nav" role="navigation">
      <ul class="drawer-menu">
        <li><a class="drawer-brand drawer-toggle" href="javascript:void();"><img src="images/menu/close-icon.png"> HOME</a></li>
        <li><a href="index.php">Home</a></li>
        <li><a href="#">FAVORITES</a></li>
        <li><a href="#">DASHBOARD</a></li>
        
        <li class="drawer-dropdown"><a href="javascript:void();" class="submenu"> SETUP <span>&nbsp;</span></a>
        
       <ul class="drawer-dropdown-menu dropdown">
            <li><a href="setup.php">SETUP</a></li>
            <li><a href="setup-company.php">SETUP COMPANY</a></li>
            <li><a href="setup-client-preferences.php">SETUP CLIENT PREFERENCES</a></li>
            <li><a href="setup-appointments-emails.php">SETUP APPOINTMENTS & EMAILS</a></li>
            <li><a href="setup-services.php">SETUP SERVICES</a></li>
            <li><a href="setup-inventory.php">SETUP INVENTORY</a></li>
			<li><a href="#">SETUP FAVORITES</a></li>
            <li><a href="setup-memberships.php">SETUP MEMBERSHIPS</a></li>
            <li><a href="setup-workers.php">SETUP WORKERS</a></li>
            <li><a href="setup-ticket-preferences.php">SETUP TICKET PREFERENCES</a></li>
          </ul>
        
        </li>
        
        <li><a href="#"> CLIENTS</a></li>
        <li><a href="#"> appointments</a></li>
        <li><a href="#"> MEMBER CHECK IN</a></li>
        <li><a href="#">GIFT BALANCES</a></li>
        <li><a href="#">inventory</a></li>
        <li><a href="#">check out</a></li>
        <li><a href="#">reports</a></li>
        
        <li class="drawer-dropdown"><a href="javascript:void();" class="submenu">marketing <span>&nbsp;</span></a>
        
        <ul class="drawer-dropdown-menu dropdown">
            <li><a href="setup-promotions.php">Setup Promotions</a></li>
            <li><a href="setup-rewards.php">Setup Rewards</a></li>
            <li><a href="#">Marketing Email</a></li>
            <li><a href="marketing-sets.php">Marketing Sets</a></li>
            <li><a href="marketing-reports.php">Marketing Reports</a></li>
            <li><a href="#">Email Activity</a></li>
            
          </ul>
        
        </li>
        
        
        
        <li><a href="#">time clock</a></li>
        <li><a href="#">logout</a></li>
        
      </ul>
    </nav>
  </div>



 <div id="wrapper">
	<header>
		<div class="top-header">
			<div class="container">
				<div class="row">
					<div class="col-md-6 col-sm-6 col-xs-6">
						<a href="javascript:void(0);" class="menu-link drawer-toggle">
							<i class="fa fa-bars"></i> HOME
                        </a>
					</div>
				</div>
			</div>
		</div>
		
		
		
		
	</header>
	
	
	

	

	</div>

	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/iScroll/5.2.0/iscroll.js"></script>
	<script src="js/drawer.min.js"></script>
  <script>
    $(document).ready(function() {
      $('.drawer').drawer();
    });
  </script>
  
   <script>
  $(document).ready(function(){
    $(".submenu").click(function(){
		$(this).parent().find(".dropdown").slideToggle();
    }); 
});
  </script>
  
  
</body>
</html>

请帮帮我

0 个答案:

没有答案