const body = document.body; const app = document.queryselector("#app"); const debounce = (callback, delay) => { let timer = null; return () => { if (timer) { cleartimeout(timer); } timer = settimeout(() => { callback(); }, delay); }; }; const throttle = (callback, duration) => { let timer = null; return () => { if (!timer) { callback(); timer = settimeout(() => { cleartimeout(timer); timer = null; }, duration); } }; }; // /* 加载动画 */ // // const jzloadingdh = () => { // var jzloadingbox = document.createelement("div"); // var jzloading = document.createelement("div"); // var jzldspan = document.createelement("span"); // jzloadingbox.classlist.add("jzloadingbox"); // jzloading.classlist.add("jzloading"); // jzldspan.innertext = "湖北航天电缆"; // jzloading.appendchild(jzldspan); // jzloadingbox.appendchild(jzloading) // body.appendchild(jzloadingbox); // // } // // document.onreadystatechange = () => { // // // if (document.readystate == "complete") { // /* console.log(body.children[body.children.length - 1]); */ // body.removechild(body.children[body.children.length - 1]) // } // else {jzloadingdh()}; // }