$(document).ready(function(){ Ani(); }); //当改变宽度时 $(window).resize(function(){ }); function Ani(){ init = function(){ fadeInTop(); smallUp(); listsmallup(); } fadeInTop = function(){ if($(".ani-fadeInToTop").length > 0){ var fadeInToTopS = new Array(); $(".ani-fadeInToTop").each(function(i){ fadeInToTopS[i] = $(this).offset().top-($(window).height()*0.5); }); aniScroll(".ani-fadeInToTop",fadeInToTopS); } } smallUp = function(){ if($(".ani-smallUp").length > 0){ var smallUps = new Array(); $(".ani-smallUp").each(function(i){ smallUps[i] = $(this).offset().top-($(window).height()*0.5); }); aniScroll(".ani-smallUp",smallUps); } } listsmallup = function(){ if($(".ani-listSmallUp").length > 0){ var listsmallups = new Array(); $(".ani-listSmallUp").each(function(i){ listsmallups[i] = $(this).offset().top-($(window).height() *0.8); }); aniScroll(".ani-listSmallUp",listsmallups); } } aniList = function(obj,i){ setTimeout(function(){ obj.addClass("on"); },i*100) } //绑定滚动条事件 aniScroll = function(objName,arr){ var st = $(document).scrollTop(); for(var i = 0 ; i= arr[i]-($(window).height()*0.5)){ if(objName == '.ani-listSmallUp'){ $(".ani-listSmallUp").eq(i).find("li").each(function(e){ aniList($(this),e); }); }else{ $(objName).eq(i).addClass("on"); } } } $(window).scroll(function(){ st = $(document).scrollTop(); for(var i = 0 ; i= arr[i]){ if(objName == '.ani-listSmallUp'){ $(".ani-listSmallUp").eq(i).find("li").each(function(e){ aniList($(this),e); }); }else{ $(objName).eq(i).addClass("on"); } } } }); } init(); } $(document).ready(function(){ // 发展历程 evenBox(); function evenBox(){ //$(".thing-box").addClass("even"); $(".thing-box").each(function(index,el){ var _index = $(this).index(".thing-box"); if(_index%2==1){ $(this).addClass("even"); } }) } $(window).load(function(){ history(); }); function history(){ if($(".history-list").length<1) return false; var yearArr = []; for (var i=0;i< $(".yui_year").length;i++){ yearArr[i]= $(".yui_year").eq(i).offset().top; } var _titT = $(".c-title").offset().top; var _bar = $(".nav-year-select"); _bar.find("li a").click(function(e){ e.preventDefault(); var _cur = $(this).closest("li").index(); $("body,html").stop().animate({"scrollTop":yearArr[_cur]},600); }); yearani(); $(window).scroll(function(){ yearani(); }); function yearani(){ var _sct = $(document).scrollTop(); if(_titT<=_sct){ _bar.addClass("fixed"); }else{ _bar.removeClass("fixed"); } for(var i = 0;i" + tempArr[i] + ""; $('#' + s[s.length - 1]).empty(); } else { //console.log(tempArr[i]); htmlStr += "
  • " + tempArr[i][0] + "
  • "; } } var idname = '#' + s[v + 1]; $(idname).html(htmlStr); if(v<1){ getProNetworks(tempIndex); } return false; } function initIpt(v) { for (var j = v + 1, len = s.length; j < len; j++) { $(".network-query-box").eq(j).find('input[type=text]').val(opt0[j]); $(".network-query-box").eq(j).find('ul').empty(); } } // 2018-3-2 // 通过省的 遍历其下的市数组,通过市遍历其下网点,整合到 str 中,返回 //getProNetworks("0_16"); function getProNetworks(tempIndex2){ // tempIndex 是省的id var htmlStrP = ""; var tempArr2 = dsy[tempIndex2]; for (var i = 0, len = tempArr2.length; i < len; i++) { // console.log(tempIndex2 + "_" + i); var tempArr3 = dsy[tempIndex2 + "_" + i]; // console.log(tempArr3); for(var j=0;j0){ var networkName = tempArr3[j][0]; var networkAddress = tempArr3[j][1]; var networkTel = tempArr3[j][2]; htmlStrP +='
    ' +'

    '+ networkName +'

    ' +'

    '+ networkAddress +'

    ' +'

    电话:'+ networkTel +'

    ' +'
    '; } } } if(htmlStrP==""){ htmlStrP +='
    ' +'

    '+ "持续更新中……" +'

    ' +'
    '; } // console.log(htmlStrP); $('.network-list-box').html(htmlStrP); } // 2018-3-2 --end //初始化下拉框 changeP(-1, 0); function initAreaList() { //默认省份 changeP(0, "0_0"); } initAreaList(); $(document).on("click", function (e) { var targ = $(e.target); if (targ.parents().hasClass("network-query") || targ.hasClass("network-query")) { return false; } $('.query-list').slideUp(); }); $(document).off("click", ".network-query-box input[type=text]").on("click", ".network-query-box input[type=text]", function () { var theArea = $(this).siblings('.query-list'); $('.query-list').hide(); theArea.stop().slideDown(300); }); $('.query-list').on("click", "li", function () { var _this = $(this), list = _this.parents('.query-list'); var areaName = ""; areaName = _this.text(); _this.addClass("selected").siblings('li').removeClass('selected'); list.siblings('input[type=text]').val(areaName); list.slideUp(); var vx = parseInt($(this).parent().parent().siblings("input[type=text]").attr('data-area')); var tempIndex = $(this).attr("data-index"); if (vx == 0) { var province = areaName; if (province.indexOf("省") > -1) { province = province.replace("省", ""); } else if (province.indexOf("市") > -1) { province = province.replace("市", ""); } work.mapSet(province); } if (vx < 2) { changeP(vx, tempIndex); } }) //地图点击事件 work.myChart.on("click", function (param) { var mapProvince = param.name; // 联动下拉框 // var arr = dsy.Items["0"], var arr = dsy["0"], len = arr.length; for (var i = 0; i < len; i++) { if (arr[i].indexOf(mapProvince) > -1) { $('.privence-inp').val(arr[i]); $('.query-list').eq(0).find('li').eq(i).addClass("selected").siblings('li').removeClass('selected'); var tempInd = "0_" + i; changeP(0, tempInd); } } }); //从城市切换开始更新 展示网点 if($('.network--temp-list').length !== 0){ var networks = []; $('.network-query-box-2').on("click","li",function(){ // .network-list-box 展示网点名称 //取到选中的data-index var tempInd = $(this).attr('data-index'); networks = dsy[tempInd]; // console.log(networks); // networks = dsy.Items[tempInd]; // 隐藏原展示网点 for(var j = 0,showLeng = $('.network--temp-list').length;j3?3:networks.length); var maxlen = networks.length; var htmlStrP2 = ""; for(var i = 0;i '+ networkName +'' +'

    '+ networkAddress +'

    ' +'

    电话:'+ networkTel +'

    ' +''; } if(htmlStrP2==""){ htmlStrP2 +='
    ' +'

    '+ "持续更新中……" +'

    ' +'
    '; } $('.network-list-box').html(htmlStrP2); }); $('.network-query-box-3').on("click","li",function(){ var ind = Math.floor($(this).index()); var tempNetWorks = networks[ind]; // console.log(networks); $('.network--temp-list').eq(0).find(".network-name").text(networks[ind][0]); $('.network--temp-list').eq(0).find(".network-address").text(networks[ind][1]); $('.network--temp-list').eq(0).find(".network-tel").text("电话:"+networks[ind][2]); $('.network--temp-list').eq(1).hide(); $('.network--temp-list').eq(2).hide(); }) } } } // }); function loadApp() { $('#canvas').fadeIn(1000); var flipbook = $('.magazine'); // Check if the CSS was already loaded if (flipbook.width() == 0 || flipbook.height() == 0) { setTimeout(loadApp, 10); return; } // 创建flipbook flipbook.turn({ width: pageWidth, height: pageHeight, duration: 1000, //翻页速度,值越小越快 // Hardware acceleration acceleration: !isChrome(), // Enables gradients gradients: true, // Auto center this flipbook autoCenter: true, // Elevation from the edge of the flipbook when turning a page elevation: 50, // The number of pages pages: pagenums, display:viewflag, // Events when: { turning: function(event, page, view) { var book = $(this), currentPage = book.turn('page'), pages = book.turn('pages'); // Update the current URI Hash.go('page/' + page).update(); // Show and hide navigation buttons disableControls(page); $("#i-book").val(page); }, turned: function(event, page, view) { disableControls(page); $(this).turn('center'); if (page == 1) { $(this).turn('peel', 'br'); } }, missing: function(event, pages) { // Add pages that aren't in the magazine for (var i = 0; i < pages.length; i++) addPage(pages[i], $(this)); $("#i-book-num").text(pages.length); } } }); //初始化左右箭头 setArrows(); // Zoom.js $('.magazine-viewport').zoom({ flipbook: $('.magazine'), max: function() { return largeMaxWidth / $('.magazine').width(); }, when: { swipeLeft: function() { $(this).zoom('flipbook').turn('next'); console.log("left"); }, swipeRight: function() { $(this).zoom('flipbook').turn('previous'); console.log("right"); }, resize: function(event, scale, page, pageElement) { // if (scale==1) loadSmallPage(page, pageElement); // else // loadLargePage(page, pageElement); }, zoomIn: function() { $('.made').hide(); $('.magazine').removeClass('animated').addClass('zoom-in'); $('.zoom-icon').removeClass('zoom-icon-in').addClass('zoom-icon-out'); if (!window.escTip && !$.isTouch) { escTip = true; $('
    ', { 'class': 'exit-message' }). html('
    Press ESC to exit
    '). appendTo($('body')). delay(2000). animate({ opacity: 0 }, 500, function() { $(this).remove(); }); } }, zoomOut: function() { $('.exit-message').hide(); $('.thumbnails').fadeIn(); $('.made').fadeIn(); $('.zoom-icon').removeClass('zoom-icon-out').addClass('zoom-icon-in'); setTimeout(function() { $('.magazine').addClass('animated').removeClass('zoom-in'); resizeViewport(); },0); } } }); // Zoom event if ($.isTouch) $('.magazine-viewport').bind('zoom.doubleTap', zoomTo); else $('.magazine-viewport').bind('zoom.tap', zoomTo); // Using arrow keys to turn the page $(document).keydown(function(e) { var previous = 37, next = 39, esc = 27, jump = 13; switch (e.keyCode) { case previous: // left arrow $('.magazine').turn('previous'); e.preventDefault(); break; case next: //right arrow $('.magazine').turn('next'); e.preventDefault(); break; case esc: $('.magazine-viewport').zoom('zoomOut'); e.preventDefault(); break; case jump: var booknum =parseInt($("#i-book").val()); $('.magazine').turn("page",booknum); e.preventDefault(); break; } }); // URIs - Format #/page/1 Hash.on('^page\/([0-9]*)$', { yep: function(path, parts) { var page = parts[1]; if (page !== undefined) { if ($('.magazine').turn('is')) $('.magazine').turn('page', page); } }, nop: function(path) { if ($('.magazine').turn('is')) $('.magazine').turn('page', 1); } }); $(window).resize(function() { resizeViewport(); }).bind('orientationchange',function() { resizeViewport(); }); // Events for thumbnails $('.thumbnails').click(function(event) { var page; if (event.target && (page = /page-([0-9]+)/.exec($(event.target).attr('class')))) { $('.magazine').turn('page', page[1]); } }); $('.thumbnails li'). bind($.mouseEvents.over,function() { $(this).addClass('thumb-hover'); }).bind($.mouseEvents.out,function() { $(this).removeClass('thumb-hover'); }); if ($.isTouch) { $('.thumbnails'). addClass('thumbanils-touch'). bind($.mouseEvents.move,function(event) { event.preventDefault(); }); } else { $('.thumbnails ul').mouseover(function() { $('.thumbnails').addClass('thumbnails-hover'); }).mousedown(function() { return false; }).mouseout(function() { $('.thumbnails').removeClass('thumbnails-hover'); }); } // Regions if ($.isTouch) { $('.magazine').bind('touchstart', regionClick); } else { $('.magazine').click(regionClick); } // Events for the next button $('.next-button').bind($.mouseEvents.over,function() { $(this).addClass('next-button-hover'); }).bind($.mouseEvents.out,function() { $(this).removeClass('next-button-hover'); }).bind($.mouseEvents.down,function() { $(this).addClass('next-button-down'); }).bind($.mouseEvents.up,function() { $(this).removeClass('next-button-down'); }).click(function() { $('.magazine').turn('next'); setTimeout(function() { setArrows(); },300); }); // Events for the next button $('.previous-button').bind($.mouseEvents.over,function() { $(this).addClass('previous-button-hover'); }).bind($.mouseEvents.out,function() { $(this).removeClass('previous-button-hover'); }).bind($.mouseEvents.down,function() { $(this).addClass('previous-button-down'); }).bind($.mouseEvents.up,function() { $(this).removeClass('previous-button-down'); }).click(function() { $('.magazine').turn('previous'); setTimeout(function() { setArrows(); },300); }); resizeViewport(); $('.magazine').addClass('animated'); } // Zoom icon $('.zoom-icon').bind('mouseover',function() { if ($(this).hasClass('zoom-icon-in')) $(this).addClass('zoom-icon-in-hover'); if ($(this).hasClass('zoom-icon-out')) $(this).addClass('zoom-icon-out-hover'); }).bind('mouseout',function() { if ($(this).hasClass('zoom-icon-in')) $(this).removeClass('zoom-icon-in-hover'); if ($(this).hasClass('zoom-icon-out')) $(this).removeClass('zoom-icon-out-hover'); }).bind('click',function() { if ($(this).hasClass('zoom-icon-in')) $('.magazine-viewport').zoom('zoomIn'); else if ($(this).hasClass('zoom-icon-out')) $('.magazine-viewport').zoom('zoomOut'); }); $('#canvas').hide(); $(document).ready(function(){ // 以下是swiper var detailSwiper =null, detailBotSwiper = null; if($('.product-detail-swiper').length>0){ detailSwiper = new Swiper('.product-detail-swiper', { autoplay: 5000, pagination : '.product-detail-swiper .swiper-pagination', prevButton:'.product-detail-swiper .swiper-button-prev', nextButton:'.product-detail-swiper .swiper-button-next', observer:true, }); } initDetailBotSwiper(); //改变窗口大小时 更新 detailBotSwiper window.onresize = initDetailBotSwiper; function initDetailBotSwiper(){ var winWid = $(window).width(); detailBotSwiper = null; if($('.product-detail-bot-swiper').length>0){ if(winWid>750){ detailBotSwiper = new Swiper('.product-detail-bot-swiper', { autoplay: 2000, slidesPerView :3, prevButton:'.product-detail-bot-swiper .product-prev-btn', nextButton:'.product-detail-bot-swiper .product-next-btn', spaceBetween : 10, observer:true, observeParents:true, pagination : '.product-detail-bot-swiper .swiper-pagination', }) }else { detailBotSwiper = new Swiper('.product-detail-bot-swiper', { autoplay: 2000, slidesPerView :1, prevButton:'.product-detail-bot-swiper .product-prev-btn', nextButton:'.product-detail-bot-swiper .product-next-btn', spaceBetween : 10, observer:true, observeParents:true, pagination : '.product-detail-bot-swiper .swiper-pagination', }) } }else { return false; } } }); $(document).ready(function(){ // 以下是swiper var reagentSwiper =null; if($('.product-reagent-swiper').length>0){ reagentSwiper = new Swiper('.product-reagent-swiper', { autoplay: 5000, pagination : '.product-reagent-swiper .swiper-pagination', prevButton:'.product-reagent-swiper .swiper-button-prev', nextButton:'.product-reagent-swiper .swiper-button-next', observer:true, }); } }) // $(document).ready(function(){ var productNavSwiper =null, procductSwiper_1 = null, procductSwiper_2 = null; // initImgBox(); // 初始化 swiper initProductSwiper(); //改变窗口大小时 初始化 swiper imgBox window.onresize = function(){ initProductSwiper(); // initImgBox(); }; function initImgBox(){ var navImgBox = $('.product-nav-swiper .img-box'), len = navImgBox.length, wid = navImgBox.eq(0).width(); for(var i=0;i0){ if(winWid>751){ return new Swiper(str,opt) }else{ return new Swiper(str,mopt) } } } function getUrlParam(name){ var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象 var r = window.location.search.substr(1).match(reg); //匹配目标参数 if (r!=null) return decodeURIComponent(r[2]); return null; //返回参数值 } //产品导航栏切换 $('.product-nav-list .swiper-slide a').on("click",function(e){ e.preventDefault(); if($(this).parent().hasClass('on')){ return false; } $(this).parent().addClass("on").siblings().removeClass("on"); //更新产品列表 var index = $(this).parent().index()+ 1, str = '.product-box-'+index, productSwiper_3 = null, productSwiper_4 = null; $(str).show().siblings('.product').hide(); // 初始化swiper productSwiper_3 = null; productSwiper_3 = initSwiper(str + ' .product-swiper-1',{ autoplay:2000, slidesPerView :3, spaceBetween : 10, prevButton:str + ' .product-swiper-1 .product-prev-btn', nextButton:str + ' .product-swiper-1 .product-next-btn', },{ autoplay:0, slidesPerView :1, spaceBetween : 10, pagination :str + ' .product-swiper-1 .swiper-pagination', }) productSwiper_4 = null; productSwiper_4 = initSwiper(str + ' .product-swiper-2',{ autoplay:2000, slidesPerView :3, spaceBetween : 10, prevButton:str + ' .product-swiper-2 .product-prev-btn', nextButton:str + ' .product-swiper-2 .product-next-btn', },{ autoplay:0, slidesPerView :1, spaceBetween : 10, pagination :str + ' .product-swiper-2 .swiper-pagination', }) }) if($(".product-nav-list").length > 0){ var f = getUrlParam('f'); if(f != null){ $(".f-"+f+" a").trigger("click"); } } //点击加载更多 $('.load-more-btn').on("click",function(){ $(".product-list-2 li").show(); //通过ajax 请求推荐的产品 &type="免疫解决方案" $.ajax({ url:url, dataType:json, method:post, data:1, success:function(){ }, error:function(){ } }) }) }) $(document).ready(function(){ setTimeout(function(){ initIdea(); },300); $(window).resize(function(){ initIdea(); }); function initIdea(){ if($('.service-idea').length==0){return false} var wid=0,hei= 0,padtop= 0,winWid = 0,banHei = 0; wid = $('.service-idea-left').width(); winWid = $(window).width(); if(winWid > 750){ hei = wid*(470/685); }else{ hei = wid*(425/690); banHei = winWid*(700/750); $('.service-banner .sub-banner').css({"height":banHei+"px"}); } padtop = hei*0.35; $('.service-idea-left').css({"height":hei+"px"}); $('.service-idea-right').css({"height":hei+"px"}); $('.idea-box h3').css({"paddingTop":padtop+"px"}); } }) $(document).ready(function(){ }); $(document).ready(function(){ headerAct(); if($(".index-solution").length > 0){ setTimeout(indexSolution(),300) } if($(".index-news").length > 0){ indexNews() } if($(".index-banner").length > 0){ indexBanner() if($(window).width()>640){ indexFullPage(); }else{ reSetBannerHeight(); numAni($(".animateNum-1"),Math.floor($('.animateNum-1').attr('data-animatetarget')),Math.floor($('.animateNum-1').attr('data-animatetarget')/10)); setTimeout(function(){ numAni($(".animateNum-2"),Math.floor($('.animateNum-2').attr('data-animatetarget')),Math.floor($('.animateNum-2').attr('data-animatetarget')/10)); },300); numAni($(".animateNum-3"),Math.floor($('.animateNum-3').attr('data-animatetarget')),Math.floor($('.animateNum-3').attr('data-animatetarget')/10)); } } if($(".index-about").length > 0 && $(window).width()<=640){ indexAbout() } }); //当改变宽度时 $(window).resize(function(){ //indexAbout() //reSetBannerHeight() }); function indexFullPage(){ $('#indexFullPage').fullpage({ paddingTop:$(".header").height()+'px', fixedElements:'.header', onLeave:function(index,nextIndex,direction){ if(nextIndex == 5){ setTimeout(function(){ numAni($(".animateNum-1"),Math.floor($('.animateNum-1').attr('data-animatetarget')),Math.floor($('.animateNum-1').attr('data-animatetarget')/10)); setTimeout(function(){ numAni($(".animateNum-2"),Math.floor($('.animateNum-2').attr('data-animatetarget')),Math.floor($('.animateNum-2').attr('data-animatetarget')/10)); },300); numAni($(".animateNum-3"),Math.floor($('.animateNum-3').attr('data-animatetarget')),Math.floor($('.animateNum-3').attr('data-animatetarget')/10)); },500); } } }) } function numAni(el,endVal,addVal){ add(); function add(){ var value01 = $(el).text(); if(value01>=endVal){ $(el).text(endVal); return null; } value01 = parseInt(value01) + addVal; $(el).text(value01); setTimeout(add,100); } } function indexAbout(){ $(".index-about").height($(window).height()-$(".header").height()); } function reSetBannerHeight(){ var h = $(window).height()-$(".header").height(); if(h>=988){ $(".index-banner").height(988); }else{ $(".index-banner").height(h); } } function indexBanner(){ var indexBanner = new Swiper('.index-banner', { effect : 'fade', slidesPerView : 1, pagination : '.index-banner .swiper-pagination', paginationClickable :true }) //reSetBannerHeight() } function indexSolution(){ var sstConfig ; if($(window).width()>640){ sstConfig = { autoHeight: true, slidesPerView : 4 } }else{ sstConfig = { autoHeight: true, slidesPerView : 'auto' } } var solutionSwiperTab = new Swiper('.index-solution .tab', sstConfig) var solutionSwiperContent = new Swiper('.index-solution .content', { autoHeight: true, slidesPerView : 1 }) if($(window).width()>640){ solutionSwiperContent.disableTouchControl(); } $(".index-solution .solution-tab ul li").click(function(){ $(this).addClass("on").siblings("li").removeClass("on"); $(".index-solution .solution-box").eq($(this).index()).addClass("on").siblings(".solution-box").removeClass("on"); solutionSwiperContent.slideTo($(this).index(), 500, false);//切换到第一个slide,速度为1秒 }); } function indexNews(){ setTimeout(function(){ var boxNewsSwiper = new Swiper('.index-news .index-news-box', { autoHeight: true, slidesPerView : 1, }) boxNewsSwiper.disableTouchControl(); $(".index-news .index-title dl dd").click(function(){ boxNewsSwiper.slideTo($(this).index(), 500, false);//切换到第一个slide,速度为1秒 $(this).addClass("on").siblings().removeClass("on"); }); },300) $(".index-news-item").each(function(e){ var tempClass = 'ini'+e; $(this).addClass(tempClass); if($(window).width() <= 1024){ var newsTextSwiper = new Swiper('.'+tempClass+' .news-text', { autoHeight: true, slidesPerView : 1, loop:true, pagination : '.'+tempClass+' .swiper-pagination', paginationClickable :true, }) }else{ var newsTextSwiper = new Swiper('.'+tempClass+' .news-text', { autoHeight: true, slidesPerView : 1, effect : 'fade', loop:true, //slidesPerView: 'auto', //spaceBetween : 20 }) newsTextSwiper.disableTouchControl(); } var newsPicSwiper = new Swiper('.'+tempClass+' .news-pic', { autoHeight: true, slidesPerView : 2, spaceBetween : 20, loop:true }) $('.'+tempClass+" .news-btn .next").click(function(){ newsTextSwiper.slideNext(); newsPicSwiper.slideNext(); }); $('.'+tempClass+" .news-btn .prev").click(function(){ newsTextSwiper.slidePrev(); newsPicSwiper.slidePrev(); }); }); } function headerAct(){ $(".search").click(function(){ if($(".header-search-box").hasClass("on")){ $(".header-search-box").removeClass("on"); }else{ $(".header-search-box").addClass("on"); } }); $(".header-search-box .close").click(function(){ $(".header-search-box").removeClass("on"); }); $(".mobile-menu").click(function(){ if($(this).hasClass("close")){ $(this).removeClass("close") $(".mobile-nav").removeClass("on") }else{ $(this).addClass("close") $(".mobile-nav").addClass("on") } }); $(".mobile-nav ul li .btn").click(function(){ if($(this).parents("li").hasClass("on")){ $(this).parents("li").removeClass("on") }else{ $(this).parents("li").addClass("on").siblings().removeClass("on"); } }); } $(document).ready(function(){ var mobiShare = $('.news-page-box .mobi-share').eq(0); if(mobiShare.length>0){ $(document).on("click",function(e){ if($('.wechat-qrcode').hasClass('onShow')){ var targ = $(e.target); if( targ.parents().hasClass("wechat-qrcode") || targ.hasClass("wechat-qrcode") || targ.hasClass("icon-wechat") ){ return false; } $('.wechat-qrcode').hide().removeClass('onShow'); } }) $('.icon-wechat').on('click',function(e){ e.stopPropagation(); $(this).find('.wechat-qrcode').show().addClass('onShow'); }) } }) $(document).ready(function(){ initNavSilde(); $(window).resize(function(){ initNavSilde(); }) $(window).scroll(function(){ initNavSilde(); }) function initNavSilde(){ var navSlides = $('.header-nav-slide'); var classNameArr = ['slideUl_2','slideUl_3','slideUl_4','slideUl_5']; navSlides.each(function(){ var slideUl = $(this).find('ul'); var slideLi = $(this).find('li'); var slideLileng = slideLi.length; var newClass = 'slideUl_'+ slideLileng; for(var i = 0;i1){ slideNav(str); } },function(){ clearTimeout(navTimer); navTimer = setTimeout(function(){ $('.header-nav-slide').slideUp(); $('.navHover').removeClass('navHover'); },500); }) $('.header-nav-slide').hover(function(){ clearTimeout(navTimer); },function(){ clearTimeout(navTimer); navTimer = setTimeout(function(){ $('.header-nav-slide').slideUp(); $('.navHover').removeClass('navHover'); },500); }) function slideNav(str) { clearTimeout(navTimer); $(str).slideDown(); $(str).siblings('.header-nav-slide').slideUp(); } })