$(document).ready(function() { if(navigator.appName == "Microsoft Internet Explorer"&&parseInt(navigator.appVersion.split(";")[1].replace(/[ ]/g, "").replace("MSIE",""))<9){ //document.getElementById('browser-modal').style.display='block'; $('body').append('

请升级浏览器版本

你正在使用旧版本浏览器。请升级浏览器以获得更好的体验。

') //console.log("您的浏览器版本过低,请使用IE9以上版本"); } // 手机导航 $('.menuBtn').append(''); $('.menuBtn').click(function(event) { $(this).toggleClass('open'); var _winw = $(window).width(); var _winh = $(window).height(); if ($(this).hasClass('open')) { $('body').addClass('open'); if (_winw <= 1200) { $('.nav-m').stop().slideDown(); } } else { $('body').removeClass('open'); if (_winw <= 1200) { $('.nav-m').stop().slideUp(); } } }); $(window).on('resize', function(e) { if ($(window).width() > 1200) { $('.menuBtn').removeClass('open'); $('.nv').css('display', ''); } }); // if ($(".nv li").find('.sub').length) { // $(".nv li").find(".sub").siblings("a").attr("href","javascript:;") // } ; function myNav() { var _winw = $(window).width(); if (_winw >= 1200) { $('.nv li').bind('mouseenter', function() { $(this).find('.sub').stop().slideDown(); if ($(this).find('.sub').length) { $(this).addClass('ok'); } }); $('.nv li').bind('mouseleave', function() { $(this).removeClass('ok'); $(this).find('.sub').stop().slideUp(); }); $('body,.menuBtn').removeClass('open'); } else { $('.nv .v1').click(function() { $(this).parents(".nv").find(".sub").stop().slideUp(); if ($(this).siblings('.sub').length) { $(this).siblings('.sub').stop().slideToggle(); return false; } }); } } myNav(); $(window).resize(function(event) { myNav(); $('.menuBtn').removeClass('open'); }); // 头部导航悬浮 $(document).on('scroll', function() { var scrollH = $(this).scrollTop(); if (scrollH > 0) { $('.header').addClass('fixed'); } else { $('.header').removeClass('fixed'); } }) // 搜索 $(".search-btn").click(function(event) { $(".g-so").fadeIn(); $(".g-so .so .inp").focus(); }); $(".g-so .close").click(function(event) { $(this).parent(".g-so").fadeOut(); }); // 二维码 $(".fd-r .con .icon").hover(function() { $(this).siblings(".ma").stop().slideToggle(); }) // 右边 $(".g-right .con").hover(function() { $(this).parents(".g-right").stop().toggleClass('open'); }) // 选项卡 鼠标点击切换 $(".TAB_CLICK li").click(function() { var tab = $(this).parent(".TAB_CLICK"); var con = tab.attr("id"); var on = tab.find("li").index(this); $(this).addClass('on').siblings(tab.find("li")).removeClass('on'); $(con).eq(on).show().siblings(con).hide(); }); $(".TAB_CLICK2 li").click(function() { var tab = $(this).parent(".TAB_CLICK2"); var con = tab.attr("id"); var on = tab.find("li").index(this); $(this).addClass('on').siblings(tab.find("li")).removeClass('on'); $(con).eq(on).removeClass('hide').siblings(con).addClass('hide'); }); // 返回顶部 $('.go-top').click(function(){ $('body,html').animate({ 'scrollTop':0 }, 500); }); });