// 判断浏览器版本过低提示 (function(window) { var theUA = window.navigator.userAgent.toLowerCase(); if ((theUA.match(/msie\s\d+/) && theUA.match(/msie\s\d+/)[0]) || (theUA.match(/trident\s?\d+/) && theUA.match(/trident\s?\d+/)[0])) { var ieVersion = theUA.match(/msie\s\d+/)[0].match(/\d+/)[0] || theUA.match(/trident\s?\d+/)[0]; if (ieVersion < 9) { var str = "本站不再支持您的浏览器,360、sogou等浏览器请切换到极速模式
或升级您的浏览器到 更高的版本!以获得更好的观看效果。"; document.writeln("
" +            "

" + str + "

"); document.execCommand("Stop"); }; } })(window); // 弹出搜索框 function searchClick() { $("#search").fadeToggle(600); } // 点击导航外,导航消失 $(document).ready(function() { $('#nav-fixed').click(function() { $('body').toggleClass('side-right'); $('.navbar-collapse').toggleClass('in') }) }); $(window).scroll(function(){ //在window的滚动回调方法中,我们处理具体逻辑 var scrollTop = document.documentElement.scrollTop || document.body.scrollTop; /* 以上代码获取滚动后,离顶端距离,这里使用两个值是为了兼容不同浏览器及其不同doctype定义 */ if(scrollTop > 200){ /*当滚动超过200px*/ $('.header-show').addClass("page-box"); }else{ $('.header-show').removeClass("page-box"); } });