// 判断浏览器版本过低提示 jQuery("img").on("mousedown", function(e) { e.preventDefault(); }); if ( navigator.appName == "Microsoft Internet Explorer" && parseInt( navigator.appVersion.split(";")[1].replace(/[ ]/g, "").replace("MSIE", "") ) < 10 ) { $("body").append( '
' ); } $("body").wrapInner(''); // 头部固定开始 var doc = $(document); $(window).scroll(function() { if (doc.scrollTop() >= 200) { $(".header").addClass("header2"); } else { $(".header2").removeClass("header2"); } }); // 点击弹出搜索框 $(".search-btn").click(function() { $(".search-box").toggle(300); }); // 点击导航外,导航消失 $("#nav-button").click(function() { $("body").addClass("side-right"); }); // 手机版导航 $(".navbar .navbar-nav .hasChild em").click(function(event) { $(this).parent().toggleClass("on").siblings().removeClass("on"); }); $(".wrapper .mask").click(function(e) { if ($("body").hasClass("side-right")) { $("body").removeClass("side-right"); $(".navbar li.hasChild").removeClass("on"); } }); // 侧导航 $(".sideMenu ul li").hover( function() { if (!$(this).hasClass("current")) { $(this).children("dl").slideDown(300); } }, function() { if (!$(this).hasClass("current")) { $(this).children("dl").slideUp(300); } } ); // 倒计时 $(function() { var starttime = new Date("2022/10/30"); setInterval(function() { var nowtime = new Date(); var time = starttime - nowtime; var day = parseInt(time / 1000 / 60 / 60 / 24); var hour = parseInt(time / 1000 / 60 / 60 % 24); var minute = parseInt(time / 1000 / 60 % 60); var seconds = parseInt(time / 1000 % 60); $('.djs').html('倒计时' + day + '天
'); }, 200); })