//top fixed $(window).scroll(function () { if ($(window).scrollTop() > 0) { $('#c_navigation_006_P_764-1676894762632').addClass('active') } else { $('#c_navigation_006_P_764-1676894762632').removeClass('active') } }) $('#c_navigation_006_P_764-1676894762632').mouseenter(function () { $('#c_navigation_006_P_764-1676894762632').addClass('active') }).mouseleave(function () { if ($(window).scrollTop() == 0) { $('#c_navigation_006_P_764-1676894762632').removeClass('active') } }); //products details /*$(document).ready(function () { $('.sp-wrap').smoothproducts(); }); */ $(function () { // bottom nav $('.bottom_nav .p_level1Box .p_level1Item').find('.p_level2Box').parents('.p_level1Item').addClass('open'); // search open $('.header .h_head .h_search').click(function () { $('.top_search').stop().slideToggle() $('.top_search').toggleClass('on') $(this).toggleClass('on') }) // search close $('.top_search .bg').click(function () { $('.top_search').stop().slideUp() $('.top_search').removeClass('on') }) // subnav light var urlName = window.location.pathname; $('.e_container-1 .p_list .p_loopitem .s_title a').each(function () { var urlHref = $(this).attr('href'); if (urlName.indexOf(urlHref) >= 0) { $(this).addClass('on'); $(this).parent().parent("div").addClass('active'); } }); if ($(window).width() < 769) { if ($('.e_container-1 .p_list .p_loopitem.active').length > 0) { var left = $('.e_container-1 .p_list .p_loopitem.active').offset().left; console.log(left) console.log($(window).width() / 2) if (left > ($(window).width() / 2)) { $(".e_container-1 .p_list").scrollLeft(left / 2); } } } //news noimg $('.Newscon .s_img').find('img').parents('.e_container-5').addClass('hasimg'); //join us $('.joblist > .e_container-27 > .p_item').on('click', function () { $(this).parent().siblings('.e_container-14').slideToggle() .parent().siblings('.joblist').children('.e_container-14').slideUp(); $(this).parent().parent().toggleClass("j_cur"); $(this).parent().parent().siblings('.j_cur').removeClass("j_cur"); }); $('.position_list > .p_list > .joblist:nth-child(1) > .e_container-27 > .p_item').trigger('click'); //home banner var swiperFlag = false; var wyzVido = new Swiper('.e_bannerA-2 .swiper-container', { autoplay: { delay: 6000, stopOnLastSlide: false, disableOnInteraction: true, }, speed: 1200, loop: true, navigation: { nextEl: '.e_bannerA-2 .p_btn_next ', prevEl: '.e_bannerA-2 .p_btn_prev ', }, pagination: { el: '.e_bannerA-2 .p_pagenation', clickable: true, }, // 切换完毕事件 on: { init: function () { }, slideChangeTransitionEnd: function () { var _this = $('.e_bannerA-2 .swiper-container .swiper-slide').eq(this.activeIndex); // 执行一下 if (!swiperFlag) { swiperFlag = true; } else { videoSelect(_this); } } } }); videoSelect($('.e_bannerA-2 .swiper-container .swiper-slide.swiper-slide-active')); function videoSelect(_this) { var cc = _this.find('.videoContent .video').length; console.log(cc); if (cc) { wyzVido.autoplay.stop(); _this.find('.videoContent .video').trigger('play'); _this.find('video').bind('ended', function () { wyzVido.slideNext(); wyzVido.autoplay.start(); }); } } //home products list var wind_w = $(window).width(), wind_h = $(window).height(); var nvN = 4, ds = 116, sBM = 20; if (wind_w <= 768) { nvN = 1.3; ds = 50; sBM = 10; } var SoluL = new Swiper('.ind_pro_list .swiper-container', { slideActiveClass: 'active', slidesPerView: nvN, slidesPerGroup: 1, speed: 1000, loop: false, observer: true, observeParents: true, spaceBetween: sBM, grabCursor: true, // mousewheel: true, // mousewheel: { // releaseOnEdges: true, // }, scrollbar: { el: '.ind_pro_btn .swiper-scrollbar', draggable: true, }, pagination: { el: '.ind_pro_btn .swiper-pagination', type: 'custom', renderCustom: function (swiper, current, total) { if (current < 10) { current = "0" + current } if (total < 10) { total = "0" + total } return '
' + current + '
/' + total; } }, }); //application var ApplicationL = new Swiper('.ind_app_list .swiper-container', { autoplay: { delay: 3000, stopOnLastSlide: false, disableOnInteraction: true, }, speed: 1000, slidesPerView: 5, slidesPerGroup: 1, spaceBetween: 30, loop: true, centeredSlides: true, preventClicks: false,//默认true pagination: { el: '.ind_app_btn .swiper-pagination', clickable: true, }, preventClicks: false,//默认true paginationClickable: true, breakpoints: { 768: { slidesPerView: 2.2, slidesPerGroup: 1, spaceBetween: 5 } }, observer: true, observeParents: true, }) //home news list var NewList = new Swiper('.newList .swiper-container', { slideActiveClass: 'active', slidesPerView: 3, slidesPerGroup: 3, spaceBetween: 30, speed: 1000, breakpoints: { //当宽度小于等于320 1024: { slidesPerView: 2.2, slidesPerGroup: 2, spaceBetween: 15 }, 767: { slidesPerView: 1.2, slidesPerGroup: 1, centeredSlides: true, spaceBetween: 10 } }, navigation: { nextEl: '.newList .swiper-button-next', prevEl: '.newList .swiper-button-prev', }, pagination: { el: '.newList .swiper-pagination', clickable: true, }, observer: true, observeParents: true, }); //related products var reproSwiper = new Swiper('.repro_con.swiper-container', { autoplay: { delay: 4000, stopOnLastSlide: false, disableOnInteraction: false, }, loop: false, slideActiveClass: 'active', initialSlide: 0, //默认显示第几张 mousewheel: false, slidesPerView: 4, spaceBetween: 0, speed: 600, observer: true, observeParents: true, watchSlidesVisibility: true, centerInsufficientSlides: true, navigation: { nextEl: '.repro_con .swiper-button-next', prevEl: '.repro_con .swiper-button-prev', }, scrollbar: { el: '.repro_con .swiper-scrollbar', }, pagination: { el: '.repro_con .swiper-pagination', clickable: true, }, breakpoints: { 768: { slidesPerView: 2, spaceBetween: 5 }, 1024: { slidesPerView: 3, spaceBetween: 0 } } }); //bottom kf $(window).on("load scroll", function () { var top = $(document).scrollTop(), wHeight = $(window).height(); if (top >= 100) { $(".sideBar").fadeIn("fast"); $(".wyz-top").fadeIn("fast"); $(".wyz").css({ "height": 50 }); } else { $(".sideBar").hide(); $(".wyz-top").hide(); $(".wyz").removeAttr("style"); } }); $(".side6").on("click", function () { $("html,body").stop().animate({ scrollTop: 0 }, 500); }); $(".wyz-top").on("click", function () { $("html,body").stop().animate({ scrollTop: 0 }, 500); }); });