//Search $(document).ready(function() { if (isFrontEnv()) { //招聘信息 $(".yx_JoinBtn").eq(0).addClass('Active'); $(".yx_JoinCon").eq(0).addClass('yx_Active'); $(".yx_JoinBtn").on('click',function(){ $(".yx_JoinBtn").removeClass('Active'); $(".yx_JoinCon").removeClass('yx_Active'); $(this).addClass('Active'); $(this).next(".yx_JoinCon").addClass('yx_Active'); }); //首页产品切换 $("#c_static_001-1675042801544 .e_loop-18 .p_loopitem").eq(0).addClass('yx_Active'); $("#c_static_001-16765987481380 .e_container-36 > .p_item > div").hide() $("#c_static_001-16765987481380 .e_container-36 > .p_item > div").eq(0).show(); $("#c_static_001-1675042801544 .e_loop-18 .p_loopitem").on('click',function(){ var index = $(this).index(); $(this).addClass('yx_Active').siblings().removeClass('yx_Active'); $("#c_static_001-16765987481380 .e_container-36 > .p_item > div").eq(index).show(); $("#c_static_001-16765987481380 .e_container-36 > .p_item > div").eq(index).siblings().hide(); }); } }); $require(['swiper'], function () { //相关产品 var RelaProSwiper = new Swiper('.RelaProSwiper', { loop: true, slidesPerView: 2, spaceBetween: 14, breakpoints: { 768: { slidesPerView: 3, spaceBetween: 16 }, 1366: { slidesPerView: 4, spaceBetween: 24 } }, pagination: { el: '.RelaProSwiper .yx_Pagin', clickable :true, }, autoplay: { delay: 5000, stopOnLastSlide: false, disableOnInteraction: true, }, observer: true, observeParents: true, }); //首页-3 产品 var InProducts = new Swiper('.InProducts', { loop: true, slidesPerView: 1, spaceBetween: 16, grid: { fill: 'row', rows: 2, }, breakpoints: { 500: { slidesPerView: 2, spaceBetween:18 }, 768: { slidesPerView: 3, spaceBetween: 16 }, 1366: { slidesPerView: 3, spaceBetween: 30 } }, navigation: { nextEl: '.InProNext', prevEl: '.InProPrev', }, autoplay: { delay: 5000, stopOnLastSlide: false, disableOnInteraction: true, }, observer: true, observeParents: true, }); //首页产品 var InProducts = new Swiper('.InProducts .swiper', { loop: true, slidesPerView: 1, spaceBetween: 14, breakpoints: { 500: { slidesPerView: 2, spaceBetween: 16 }, 768: { slidesPerView: 3, spaceBetween: 16 }, 1366: { slidesPerView: 4, spaceBetween: 24 } }, navigation: { nextEl: '.InProducts .yx_SNext', prevEl: '.InProducts .yx_SPrev', }, autoplay: { delay: 3000, stopOnLastSlide: false, disableOnInteraction: true, }, observer: true, observeParents: true, }); }); //客服 $(function() { $('.yx_KfClose').on('click', function(event) { $(".yx_KfBox").css({ "display": "none" }); }); // 回到顶部的显示与隐藏 $(window).on("load scroll", function() { var top = $(document).scrollTop(), wHeight = $(window).height()/3; if (top > wHeight) { $(".yx_KfBox").addClass("yx_Active"); } else { $(".yx_KfBox").removeClass("yx_Active"); } }); // 回到顶部 $(".yx_Up_Button").on("click", function() { $("html,body").stop().animate({ scrollTop: 0 }, 500); }); //锚点缓动 $('.yx_HD_Btn').click(function() { $('html,body').animate({ scrollTop: ($($(this).attr('href')).offset().top - 160) }, 800); }); }); //移动端分类样式 $(".yx_MoPageBtn").on('click', function() { $(this).next().css("left", "0px"); }); $(".yx_MoPageClose").on('click', function() { $(this).parent().css("left", "100%"); }); //首页产品中心 $(function() { $("#c_static_001-1667035003716 .e_categoryC-4 .p_c_item").eq(0).addClass("yx_Active"); $("#c_static_001-1667035003716 .e_categoryC-4 .p_c_item").mouseenter(function() { var p_index = $(this).index(); $(this).addClass("yx_Active").siblings().removeClass("yx_Active"); $("#c_magiccube_009-1667037224464 .content-box").eq(p_index).addClass("active").siblings().removeClass("active"); }) }); //产品页分类 $(function(){ $(".yx_icon1").on('click',function(){ $(".yx_icon1").css('transform','translateY(-50%) rotate(0deg)'); $(this).css('transform','translateY(-50%) rotate(90deg)').parent().next(".yx_PPBox2").slideToggle('slow'); $(this).parents().siblings().find(".yx_PPBox2").slideUp('slow'); }); $(".yx_icon2").on('click',function(){ $(".yx_icon2").css('transform','translateY(-50%) rotate(0deg)'); $(this).css('transform','translateY(-50%) rotate(90deg)').parent().next(".yx_PPBox3").slideToggle('slow'); $(this).parents().siblings().find(".yx_PPBox3").slideUp('slow'); }); //产品页分类高亮 var pathName = window.location.pathname; // 获得路径信息 var subUrl = pathName.substring(pathName.lastIndexOf("/")); $(".yx_PPBox .yx_PT_Link").each(function(){ // 遍历a链接的路径 var aLinkUrl = $(this).attr("href"); // 得到a链接的路径 if(aLinkUrl == pathName){ $(this).addClass("yx_Click"); $(this).parentsUntil(".yx_MoPageBtn").slideDown('slow'); return; }; }); $("#c_static_001-1672793680119 .e_loop-22 .p_loopitem").eq(0).addClass("bds_more"); $("#c_static_001-1672793680119 .e_loop-22 .p_loopitem").eq(0).addClass("share"); $("#c_static_001-1672793680119 .e_loop-22 .p_loopitem").eq(0).addClass("link_c"); }); wow = new WOW( { animateClass: 'animated', offset:100, } ); wow.init();