/* * @author: xyy * @version: 1.0.0 * @descripttion: * @date: 2022-09-13 14:27:31 * @lasteditors: please set lasteditors * @lastedittime: 2022-10-27 16:53:31 * @filepath: */ //自适应 $(document).bind("click", function () { $(".menu").css("display", "none"); }); $(".menu-btn").click((e) => { stoppropagation(e); //调用停止冒泡方法,阻止document方法的执行 $(".menu").toggle(); }); $(".menu").click((e) => { stoppropagation(e); //调用停止冒泡方法,阻止document方法的执行 console.log("跳转到下一页"); }); // var timer = null; // fn(); function stoppropagation(e) { if (e.stoppropagation) e.stoppropagation(); //停止冒泡 非ie else e.cancelbubble = true; //停止冒泡 ie } if ($(window).width() <= 750) { let currentwidth = $(".resizewidth>.col1").width(); $(".resizewidth>.col1").height(currentwidth); } $(window).resize(() => { if ($(window).width() <= 750) { let currentwidth = $(".resizewidth>.col1").width(); $(".resizewidth>.col1").height(currentwidth); } }); $(".totop").click(function () { $("html, body").animate({ scrolltop: 0, }); });