// 顶部导航效果 //top fixed $(window).scroll(function () { if ($(window).scrollTop() > 0) { $('#c_navigation_006_P_093-16488653441420').addClass('active') } else { $('#c_navigation_006_P_093-16488653441420').removeClass('active') } }); $('#c_navigation_006_P_093-16488653441420').mouseenter(function () { $('#c_navigation_006_P_093-16488653441420').addClass('active') }).mouseleave(function () { if ($(window).scrollTop() == 0) { $('#c_navigation_006_P_093-16488653441420').removeClass('active') } }); //language $(".head_lan .lan_con").hover(function () { $(this).find(".lan_list").addClass("cur"); }, function () { $(this).find(".lan_list").removeClass("cur"); }); // 首页轮播大图 $(function () { 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(); }); } } }); // 首页产品分类 $(function () { var galleryThumbs = new Swiper('#c_static_001_P_505-16488613045120 .pro_thum', { slidesPerView: 7, freeMode: false, watchSlidesVisibility: true, watchSlidesProgress: true, breakpoints: { 768: { slidesPerView: 3, centeredSlides: false } }, observer: true, observeParents: true, resistanceRatio: 0, }); var galleryTop = new Swiper('#c_static_001_P_506-16488613247520 .pro_cont', { loop: true, loopedSlides: 3, slideActiveClass: 'active', speed: 800, slidesPerView: 1.5, spaceBetween: 0, centeredSlides: true, breakpoints: { 768: { slidesPerView: 1, spaceBetween: 0 } }, navigation: { nextEl: '#c_static_001_P_506-16488613247520 .pro_btn .swiper-button-next', prevEl: '#c_static_001_P_506-16488613247520 .pro_btn .swiper-button-prev', }, thumbs: { swiper: galleryThumbs, thumbsContainerClass: 'my-container-active', }, pagination: { el: '#c_static_001_P_506-16488613247520 .swiper-pagination', clickable: true, }, observer: true, observeParents: true, }); }); // 首页公司优势轮播图 $(function () { $('#myRoundabout').roundabout({ duration: 500, minOpacity: 1, enableDrag: true, minScale: 1, dragFactor: 1, btnPrev: '.arr_btn_prev', btnNext: '.arr_btn_next' }); $('.arr_btn02_l').click(function (event) { $('.arr_btn_prev').trigger('click'); }); $('.arr_btn02_r').click(function (event) { $('.arr_btn_next').trigger('click'); }); }); // 内页轮播大图模糊效果 $(window).scroll(function (e) { var scrollSeviye = $(this).scrollTop(); if (scrollSeviye > 2400) { scrollSeviye = 2400; } var buyutme = (scrollSeviye / 6000) + 1; $('.e_bannerA-1 .p_img img').css('-webkit-filter', 'blur(' + scrollSeviye / 120 + 'px)'); $('.e_bannerA-1 .p_img img').css('transform', 'scale(' + buyutme + ')'); }); // 内页内容分类 $(function () { 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); } } } });