$(function () { var swiperFlag = false; var wyzVido = new Swiper('.e_bannerD-1 .swiper-container', { autoplay: { delay: 5000, stopOnLastSlide: false, disableOnInteraction: true, }, speed: 1200, loop: true, navigation: { nextEl: '.e_bannerD-1 .p_btn_next ', prevEl: '.e_bannerD-1 .p_btn_prev ', }, pagination: { el: '.e_bannerD-1 .p_pagenation', clickable: true, }, // 切换完毕事件 on: { init: function () { }, slideChangeTransitionEnd: function () { var _this = $('.e_bannerD-1 .swiper-container .swiper-slide').eq(this.activeIndex); // 执行一下 if (!swiperFlag) { swiperFlag = true; } else { videoSelect(_this); } } } }); videoSelect($('.e_bannerD-1 .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(); }); } } }); $('#c_navigation_0061635239687823').addClass('subpage'); $(function () { if ($(window).width() > 768) { var cpSwiper = new Swiper('.ind_pro.swiper-container', { // 切换速度 autoplay: { delay: 4000, stopOnLastSlide: false, disableOnInteraction: false, }, speed: 1000, // 是否循环 loop: true, slidesPerView: 4, spaceBetween: 30, breakpoints: { 1366: { slidesPerView: 4, spaceBetween: 30 } }, navigation: { nextEl: '.ind_pro .nextbtn', prevEl: '.ind_pro .prebtn ', }, // 分页 pagination: { el: '.ind_pro .swiper-pagination', // 点击控制轮播 clickable: true, }, observer: true, observeParents: true, }) } })