1. 首页
  2. 编程语言
  3. Javascript
  4. 三级菜单多选

三级菜单多选

上传者: 2018-12-18 02:27:39上传 HTML文件 4.29KB 热度 56次
三级菜单多选,$(document).ready(function() { $('.caputure').click(function(){ if($(this).siblings('ul').css('display')=='none'){ $(this).parent('li').siblings('li').slideDown(100); $(this).siblings('ul').slideDown(100).children('li'); if($(this).parents('li').siblings('li').children('ul').css('display')=='block'){ $(this).parents('li').siblings('li').children('ul').slideUp(100); } }else{ //控制子菜单隐藏 $(this).siblings('ul').slideUp(100); } }) tableCheckedAll(); tableCheckedList(); }); function tableCheckedAl l(){ $(document.body).on('click', '.tabInputList', function(){ if($(this).prop('checked')){//获取是否选中 并判断 $(this).addClass("checked"); $(".tabInput").prop('checked', true); }else{ $(".tabInput").prop('checked', false); } }); }; function tableCheckedList(){ $(document.body).on('click', '.tabInputAll', function(){ var type=$(this).data("type"); if($(this).prop('checked')){//获取是否选中 并判断 $(this).addClass("checked"); $(".tabInputLast"+type).prop('checked', true); }else{ $(".tabInputLast"+type).prop('checked', false); } }); };
下载地址
用户评论