let layer; layui.use('layer', function(){ layer = layui.layer; }); let form; layui.use('form', function(){ var form = layui.form; }); //闃叉姈鍑芥暟 function debounce(fn,delay){ let timer = null //鍊熷姪闂寘 return function() { if(timer){ clearTimeout(timer) } timer = setTimeout(function(){ fn(); },delay) // 绠€鍖栧啓娉 } } //鑺傛祦鍑芥暟 function throttle(fn,delay){ let valid = true return function() { if(!valid){ //浼戞伅鏃堕棿 鏆備笉鎺ュ return false } // 宸ヤ綔鏃堕棿锛屾墽琛屽嚱鏁板苟涓斿湪闂撮殧鏈熷唴鎶婄姸鎬佷綅璁句负鏃犳晥 valid = false setTimeout(function(){ fn() valid = true; }, delay) } } //璋冪敤 // function showTop () { // var scrollTop = document.body.scrollTop || document.documentElement.scrollTop; // 銆€銆€console.log('婊氬姩鏉′綅缃細' + scrollTop); // } // window.onscroll = throttle(showTop,1000) //鍓嶇鍔犺浇 header.html鍜 footer.html // (function(){ // $(".header").load("header.html"); // $(".footer").load("footer.html"); // })(); //menu 鏁堟灉 (function(){ $("body").on("click",".header .bars",function(){ $(this).toggleClass("active"); $(".mmenu02-box").toggleClass("active"); }) $(".mmenu02-box .mmenu01>li>.icon").click(function(event){ $(this).parent("li").addClass("active"); }) $(".mmenu02-box .mmenu02>li>.icon").click(function(event){ $(this).parent("li").addClass("active"); }) $(".mmenu02-box .mmenu02>.top").click(function(event){ $(this).parent().parent("li").removeClass("active"); }) $(".mmenu02-box .mmenu03>.top").click(function(event){ $(this).parent().parent("li").removeClass("active"); }) })(); //澶撮儴鎼滅储