$(function(){ $(document).on("click",".module5 ul>li",function(){ $(this).addClass("on").siblings().removeClass("on"); }) // banner var banner = new Swiper('.banner .swiper-container', { pagination: '.swiper-pagination', paginationBulletRender: function(swiper, index, className) { return '
'; }, autoHeight: true, observer: true, observeParents: true, paginationClickable: true, loop: true, autoPlayTime: null, autoPlayTimeIndex: 0, autoPlayTimeMax: 350, onInit: function(swiper) { clearTimeout(this.autoPlayTime); this.updateTime(swiper, true) this.setAnimte(swiper) }, onSlideChangeStart: function(swiper) { this.autoPlayTimeIndex = 0; this.updateTime(swiper, true) clearTimeout(this.autoPlayTime); this.setAnimte(swiper) }, onTouchStart: function() { clearTimeout(this.autoPlayTime); }, onTouchMove: function() { clearTimeout(this.autoPlayTime); }, onTouchEnd: function(swiper) { clearTimeout(this.autoPlayTime); this.updateTime(swiper, true) }, setAnimte: function(swiper) { swiper.slides.siblings('.swiper-slide').find('img').css('animation', ''); swiper.slides.siblings('.swiper-slide.swiper-slide-active').find('img').css({ 'animation': 'zoom ' + this.autoPlayTimeMax / 60 + 's' }); }, updateTime: function(swiper, isTrue) { this.autoPlayTimeIndex++; var video = swiper.slides.siblings('.swiper-slide.swiper-slide-active').find('video'); if (video.length > 0) { var videoDom = video.get(0); if (videoDom.readyState > 0) { if (isTrue) { videoDom.currentTime = 0; } $('.progressbar-wrap.swiper-pagination-bullet-active .progressbar').width((videoDom.currentTime / videoDom.duration) * 100 + '%'); if (videoDom.currentTime == 0) { videoDom.play(); } if (videoDom.currentTime >= videoDom.duration) { swiper.slideNext(); videoDom.currentTime = 0; } } } else { $('.progressbar-wrap.swiper-pagination-bullet-active .progressbar').width((this.autoPlayTimeIndex / this.autoPlayTimeMax) * 100 + '%'); if (this.autoPlayTimeIndex >= this.autoPlayTimeMax) { this.autoPlayTimeIndex = 0; swiper.slideNext(); } } this.autoPlayTime = setTimeout(function() { this.updateTime(swiper); }.bind(this), 10) } }); // module3 var module3_num =4; $(window).resize(function(){ if($(window).width()>1024 & $(window).width()<=1366){ module3_num =3; } if($(window).width()>767 & $(window).width()<1025){ module3_num =2; } if($(window).width()<=767){ module3_num =1; } }) $(window).resize(); var _len = $(".module3 .swiper-slide").length; if(_len>module3_num){ $(".module3 .but_pub").show(); }else{ } var module3 = new Swiper('.module3 .swiper-container', { nextButton: '.module3 .swiper-button-next', prevButton: '.module3 .swiper-button-prev', slidesPerView: 4, paginationClickable: true, spaceBetween: 16, breakpoints: { //褰撳搴﹀ぇ浜庣瓑浜?20 1366: { slidesPerView: 3, spaceBetween: 16 }, 1024: { slidesPerView: 2, spaceBetween: 10, }, 767: { slidesPerView: 1, spaceBetween: 0, } } }); // module4 var module4_num =3; $(window).resize(function(){ if($(window).width()>1024 & $(window).width()<=1366){ module4_num =3; } if($(window).width()>767 & $(window).width()<1025){ module4_num =2; } if($(window).width()<=767){ module4_num =1; } }) $(window).resize(); var module4_len = $(".module4 .swiper-slide").length; if(module4_len>module4_num){ $(".module4 .but_pub").show(); }else{ } var module4 = new Swiper('.module4 .swiper-container', { nextButton: '.module4 .swiper-button-next', prevButton: '.module4 .swiper-button-prev', slidesPerView: module4_num, paginationClickable: true, spaceBetween: 38, breakpoints: { 1024: { spaceBetween: 20 }, 767: { spaceBetween: 0 } } }); // module5 })