zoukankan      html  css  js  c++  java
  • 手风琴效果菜单

    js:

    $(function() {
    	/*****************菜单手风琴效果 start******************/
    	var Accordion = function(el, multiple) {
    		this.el = el || {};
    		this.multiple = multiple || false;
    
    		// Variables privadas
    		var menus = this.el.find('.menu');
    		// Evento
    		menus.on('click', {el: this.el, multiple: this.multiple}, this.dropdown)
    	}
    
    	Accordion.prototype.dropdown = function(e) {
    		var $el = e.data.el;
    			$this = $(this),
    			$next = $this.next();
    
    		$next.slideToggle();
    		$this.parent().toggleClass('open');
    
    		if (!e.data.multiple) {
    			$el.find('.submenu').not($next).slideUp().parent().removeClass('open');
    		};
    	}	
    	var accordion = new Accordion($('.accordion'), false);
    	/*****************菜单手风琴效果 end******************/
    	
    });
    

     html:

         <!-- aside menu start -->
    	<div id="aside-menu">
    		<ul id="accordion" class="accordion">
    			
    			<li>
    				<div class="menu"><i class="glyphicon glyphicon-tasks"></i> <span>入库管理</span><i class="glyphicon glyphicon-chevron-right pull-right"></i></div>
    				<ul class="submenu">
    					<li><a href="#">采购订单</a></li>
    					<li><a href="#">收货</a></li>
    					<li><a href="#">入库计划</a></li>
    					<li><a href="#">组托上架</a></li>
    					<li><a href="#">采购退货</a></li>
    					<li><a href="#">展示信息</a></li>
    					<li><a href="#">采购发票</a></li>
    				</ul>
    			</li>
    			<li>
    				<div class="menu"><i class="glyphicon glyphicon-user"></i> <span>出库管理</span><i class="glyphicon glyphicon-chevron-right pull-right"></i></div>
    				<ul class="submenu">
    					<li><a href="#">订单</a></li>
    					<li><a href="#">出库计划</a></li>
    					<li><a href="#">出库顺序</a></li>
    					<li><a href="#">销售退货</a></li>
    					<li><a href="#">销售发票</a></li>
    				</ul>
    			</li>
    			<li>
    				<div class="menu"><i class="glyphicon glyphicon-user"></i> <span>库存管理</span><i class="glyphicon glyphicon-chevron-right pull-right"></i></div>
    				<ul class="submenu">
    					<li><a href="#">货位图</a></li>
    					<li><a href="#">盘点计划</a></li>
    					<li><a href="#">盘点作业</a></li>
    					<li><a href="#">库存调整</a></li>
    				</ul>
    			</li>
    			
    		</ul>
    	</div>
    	<!-- aside menu end -->
    
  • 相关阅读:
    [转] iphoneX、iphoneXS、iphoneXSMax、iphoneXR适配
    [转] 以 async/await 为例,说明 babel 插件怎么搭
    [转] 使用Node.js实现简易MVC框架
    [转] vue异步处理错误
    [转] 谈谈前端异常捕获与上报
    everything 13问
    Mysql 工具mysqlbinlog
    Mysql 删除日志
    Mysql 错误 ERROR 1 (HY000) at line 1: Can't create/write to file '/home/kaizenly/cfg_dict.csv' (Errcode: 13
    Mysql 问题集
  • 原文地址:https://www.cnblogs.com/guxingzhe/p/5300919.html
Copyright © 2011-2022 走看看