function browsertype() { var useragent = navigator.useragent; //取得浏览器的useragent字符串 var isopera = useragent.indexof("opera") > -1; //判断是否opera浏览器 var isie = useragent.indexof("compatible") > -1 && useragent.indexof("msie") > -1 && !isopera; //判断是否ie浏览器 var isedge = useragent.indexof("windows nt 6.1; trident/7.0;") > -1 && !isie; //判断是否ie的edge浏览器 if (isie) { var reie = new regexp("msie (\\d+\\.\\d+);"); reie.test(useragent); var fieversion = parsefloat(regexp["$1"]); if (fieversion < 9) { alert("浏览器版本过低,请升级或更换浏览器(谷歌、火狐等)") return false; } //ie版本过低 } if (isedge) { alert("浏览器版本过低,请升级或更换浏览器(谷歌、火狐等)") return false; } } browsertype() // 浏览器是否为ie $(function () { //搜索 $(".s-btn").click(function () { $(".b-top").stop().fadein(); $("html").css("overflow", "hidden"); }) $(".t-search-zzc").click(function () { $(".b-top").stop().fadeout(); $("html").css("overflow-y", "visible"); }) //头部 head_scroll() function head_scroll() { if ($(window).scrolltop() > 0) { $(".head").stop().addclass("on"); } else { $(".head").stop().removeclass("on"); } } $(window).scroll(function () { head_scroll() }) // pc 导航下拉 $(".nav>ul>li").hover(function () { if ($(this).children("div").html()) { $(this).addclass("on"); $(this).children("div").stop(false, true).slidedown() } }, function () { $(this).removeclass("on"); $(this).children("div").stop(false, true).slideup() }); //中英文切换 $(".head-zy").hover(function () { $(".head-zy .china").stop().addclass("show"); }, function () { $(".head-zy .china").stop().removeclass("show"); }) // 移动端导航 $(".menu").click(function () { $(".m-nav").animate({ "right": "0" }, 300); $(this).hide() $(".close-menu").fadein(); $("html").css("overflow", "hidden"); }) $(".close-menu").click(function () { $(".close-menu").fadeout() $(".m-nav").animate({ "right": "-100%" }, 300); $(".menu").fadein(); $("html").css("overflow", "visible"); }) $(".m-nav>ul>li>span").click(function () { $(this).toggleclass("on").parent().siblings("li").find("span").removeclass("on") $(this).siblings("ul").slidetoggle().parent().siblings("li").find("ul").slideup() }) })