锘?(function(){ if(window.innerWidth<1200){ $('.top_bg').addClass('on'); }else{ var gdt=$(window).scrollTop(); $(window).scroll(function(){ if($(window).scrollTop()10){ $('.top_bg').addClass('on'); }else{ $('.top_bg').removeClass('on'); }; $('.top_bg').removeClass('xs'); }else{ $('.top_bg').removeClass('on'); $('.top_bg').addClass('xs'); }; gdt=$(window).scrollTop(); }); }; }); $(function(){ xydh2(); win_w(); $('body').css('opacity',1); }); function goTop(){ $('html,body').animate({'scrollTop':0},600); };/*鍦ㄧ嚎瀹㈡湇 JS*/ $(function(){ $('.top_bg').hover(function(){ $(this).addClass('on2'); },function(){ $(this).removeClass('on2'); }); $('.dh>ul>li').hover(function(){ $(this).find('.dh_fl').css('visibility','visible').hide(); $(this).find('.dh_fl').stop(true,true).slideDown().addClass('on'); },function(){ $(this).find('.dh_fl').stop(true,true).hide().removeClass('on'); }); var mySwiper = new Swiper ('.dh ul li.dhcp .dh_fl .lb.swiper', { slidesPerView: 4, spaceBetween: 40, navigation: { nextEl: '.dh ul li.dhcp .dh_fl .lb.swiper .bt .ml2 .dhqh_r', prevEl: '.dh ul li.dhcp .dh_fl .lb.swiper .bt .ml2 .dhqh_l', }, }); var mySwiper = new Swiper ('.dh ul li.dhfa .dh_fl .lb.swiper', { slidesPerView: 5, spaceBetween: 40, navigation: { nextEl: '.dh ul li.dhfa .dh_fl .lb.swiper .bt .ml2 .dhqh_r', prevEl: '.dh ul li.dhfa .dh_fl .lb.swiper .bt .ml2 .dhqh_l', }, }); var mySwiper = new Swiper ('.dh ul li.dhgy .dh_fl .lb.swiper', { slidesPerView: 5, spaceBetween: 40, navigation: { nextEl: '.dh ul li.dhgy .dh_fl .lb.swiper .bt .ml2 .dhqh_r', prevEl: '.dh ul li.dhgy .dh_fl .lb.swiper .bt .ml2 .dhqh_l', }, }); $('.top_yy').hover(function(){ $('.top_yy_xl').stop(true,true).slideDown(); },function(){ $('.top_yy_xl').slideUp(); }); $('.top_ss .button').click(function(){ $('.serach').fadeIn().addClass('on'); $('.serach form input').focus(); }); $('.serach form span').click(function(){ $('.serach').fadeOut().removeClass('on'); }); if(window.innerWidth<1200){ $('.foot_lx .ml5 ul li').click(function(e){ e.stopPropagation(); $(this).find('.xl').toggle(); $(this).siblings().find('.xl').hide(); }); $('body').click(function(){ $('.foot_lx .ml5 ul li .xl').hide(); }); }else{ $('.foot_lx .ml5 ul li').hover(function(){ $(this).find('.xl').show(); },function(){ $(this).find('.xl').hide(); }); }; $('.ny_lx .txt .gz li').hover(function(){ $(this).find('.xl').show(); },function(){ $(this).find('.xl').hide(); }); }); $(function(){ if($('.dh>ul>li').size()){ var dqxlh=0; $(".dh>ul>li").each(function(){ if($(this).hasClass('on')){dqxlh=$(this).index()} }); $(window).resize(function(){ $(".dh_tx").height($(".dh").height()).width($(".dh").width()).css({'left':$(".dh").offset().left}); $(".dh_tx i").css({'left':$(".dh>ul>li").eq(dqxlh).find('a').offset().left-$(".dh").offset().left,'width':$(".dh>ul>li").eq(dqxlh).find('a').outerWidth()}); }); window.onload=function(){ $(".dh_tx").height($(".dh").height()).width($(".dh").width()).css({'left':$(".dh").offset().left}); }; $(".dh_tx").height($(".dh").height()).width($(".dh").width()).css({'left':$(".dh").offset().left}); $(".dh_tx i").css({'left':$(".dh>ul>li").eq(dqxlh).find('a').offset().left-$(".dh").offset().left,'width':$(".dh>ul>li").eq(dqxlh).find('a').outerWidth()}); $(".dh>ul>li").hover(function(){ $(".dh>ul>li").eq(dqxlh).removeClass('on'); $(this).addClass('on'); $(".dh_tx i").css({'left':$(this).find('a').offset().left-$(".dh").offset().left,'width':$(this).find('a').outerWidth()}); },function(){ $(this).removeClass('on'); $(".dh_tx i").css({'left':$(".dh>ul>li").eq(dqxlh).find('a').offset().left-$(".dh").offset().left,'width':$(".dh>ul>li").eq(dqxlh).find('a').outerWidth()}); $(".dh>ul>li").eq(dqxlh).addClass('on'); }); }; }); $(function(){ if(window.innerWidth>1199){ $(function(){ if($(".ny_dqlj_dw").size()){ var gdt2=$(window).scrollTop(); $(window).scroll(function(){ if($(window).scrollTop()=($('.ny_dqlj_dw').offset().top-100)){ $('.ny_dqlj_bg').addClass('on'); }else { $('.ny_dqlj_bg').removeClass('on'); }; }else{ $('.ny_dqlj_bg').addClass('xs'); if($(window).scrollTop()>=($('.ny_dqlj_dw').offset().top)){ $('.ny_dqlj_bg').addClass('on'); }else { $('.ny_dqlj_bg').removeClass('on'); }; }; gdt2=$(window).scrollTop(); }); }; }); }; if(window.innerWidth>1199){ if($('.ny_dqlj').size()&&$('.ny_dqlj .fl ul li .xl').size()){ $('.ny_dqlj .fl ul li').hover(function(){ $(this).find('.xl').stop(true,true).slideDown(); },function(){ $(this).find('.xl').slideUp(); }); }; }; }); var sonMenu = function(f,s){ var menuWidth = 0; var menuMargin = parseInt($(s).children("li").css('marginRight')); $(s).children("li").each(function(){menuWidth += $(this)[0].getBoundingClientRect().width + menuMargin;}); $(s).width(menuWidth); var ontrueLeft; if($(s).children("li").hasClass("on")){ontrueLeft = $(s).children("li.on").offset().left - menuMargin}else{ontrueLeft = 0}; setTimeout(function(){$(f).animate({'scrollLeft': menuWidth-$(window).width()}, 800).after().animate({'scrollLeft': ontrueLeft}, 800)},800); }; $(function() { if($('.ny_dqlj .fl>ul').size()&&window.innerWidth<1199){ sonMenu(".ny_dqlj .fl",".ny_dqlj .fl>ul"); //绉诲姩绔?鍐呴〉鑿滃崟("瀹氫箟overflow-x: auto鐨勭埗鍏冪礌","璁剧疆瀹藉害鐨勫瓙鍏冪礌") } if($('.ny_dqlj .fl ul li.on .xl').size()&&window.innerWidth<1199){ $('.ny_dqlj .fl ul li.on .xl').addClass('nyejfl'); $('.ny_dqlj_dw').after($('.ny_dqlj .fl ul li.on .xl')); } });