// javascript document (function() { var lock = true, menubtn = $(".menubtn"), mymask = $('
').css({ 'position': 'fixed', 'display': 'none', 'width': '100%', 'height': '100%', 'top': '0', 'left': '0', 'background': 'rgba(0,0,0,.5)', 'z-index': '999998' }) $('body').prepend(mymask); menubtn.click(function() { if(lock) { $(".nav").css("height","100%").slidedown(300, function() { $(".nav ul").slidedown(400) }); menubtn.css({ "transform": "rotate(90deg)" }).find('span').css({ "background-color": "#fff" }) lock = false; //show mask mymask.fadein(600); $("body").css({ "overflow": "hidden" }); // $(document).on('touchmove',function(e){ // e.preventdefault(); // }) } else { hidenav(); $ } }) mymask.click(function() { hidenav(); }) var hidenav = function() { menubtn.css({ "transform": "rotate(0)" }).find('span').css({ "background-color": "#006dac" }) $(".nav").slideup(300).css("height","0"); $(".nav ul").hide(400); lock = true; //hide mask mymask.fadeout(600); $("body").css({ "overflow": "auto" }); // $(document).unbind("touchmove"); } })() // $(".container .nav ul li .addition").click(function (e) { // e.stoppropagation() // $(this).next(".c-show").slidetoggle(500).parents("li").siblings().find(".c-show").slideup(500); // }) // $(".container .nav ul li .c-show .c-s1 .addition").click(function (e) { // e.stoppropagation() // $(this).next(".c-s2").slidetoggle(500).parent(".c-s1").siblings().find(".c-s2").slideup(500) // }) $(".container .nav ul li > .addition").click(function (e) { e.stoppropagation() if($(this).next(".c-show1").css("display") == "none"){ $(this).next(".c-show1").slidedown(500); $(this).css("background","transparent url('/yizi.png') no-repeat center center").css("background-size","100% 100%;") } else{ $(this).next(".c-show1").slideup(500); $(this).css("background","transparent url('/shizi.png') no-repeat center center").css("background-size","100% 100%;") } }) $(".container .nav ul li .c-show1 .c-s1 > .addition").click(function (e) { e.stoppropagation() if($(this).next(".c-show2").css("display") == "none"){ $(this).next(".c-show2").slidedown(500); $(this).css("background","transparent url('/yizi.png') no-repeat center center").css("background-size","100% 100%;") } else{ $(this).next(".c-show2").slideup(500); $(this).css("background","transparent url('/shizi.png') no-repeat center center").css("background-size","100% 100%;") } }) $(".container .nav ul li .c-show1 .c-s2 .addition").click(function (e) { e.stoppropagation() if($(this).next(".c-show3").css("display") == "none"){ $(this).next(".c-show3").slidedown(500); $(this).css("background","transparent url('/yizi.png') no-repeat center center").css("background-size","100% 100%;") } else{ $(this).next(".c-show3").slideup(500); $(this).css("background","transparent url('/shizi.png') no-repeat center center").css("background-size","100% 100%;") } }) $(".container .nav > ul").height($(window).height())