jQuery(function () { function initBox() { w_width = jQuery(window).width(); w_height = jQuery(window).height(); $('.banner').css('height', w_height); $('.banner-slide,.banner-slide figure').css('height', w_height); setImgMax($('.banner-slide figure img'), 1920, 960, w_width, w_height); }; initBox(); jQuery(window).resize(function () { initBox(); }); var indexFn = { init:function (){ this.getBanner(); }, getBanner: function() { if(!isMobile){ var swiperTendance = new Swiper('.home-swiper', { speed: 1200, slidesPerView :'auto', direction: 'vertical', slidesPerView: 1, loop: false, touchRatio: '0', simulateTouch: false, autoplayDisableOnInteraction:false, mousewheelControl: true, //effect : 'fade', parallax: true, mousewheelReleaseOnEdges : true, scrollbarSnapOnRelease: true , pagination : '.swiper-pagination1', paginationClickable :true, breakpoints: { //当宽度小于等于320 1024: { mousewheelControl: false, }, }, onTransitionEnd : function(e) { }, onTransitionStart: function(e) { }, onInit: function(swiper){ let numble = `0${swiper.realIndex + 1}/0${swiper.bullets.length}`; $(".flex__numble").html(numble); }, onSlideChangeStart: function(swiper){ let numble = `0${swiper.realIndex + 1}/0${swiper.bullets.length}`; $(".flex__numble").html(numble); $(".flex__numble").html(numble); $(".flex__text__item").eq(swiper.realIndex).fadeIn().siblings().hide(); } }); } new Swiper('.banner', { speed: 1000, slidesPerView: 1, parallax: true, loop: true, effect : 'fade', autoplay : 6000, prevButton: '.banner-prev span.prev', nextButton: '.banner-prev span.next', }); var bSwiper = new Swiper('.business-swipers', { speed: 1000, slidesPerView: 1, parallax: true, loop: true, effect : 'fade', autoplay : 0, }); $(".business__ico").hover(function(){ bSwiper.slideTo($(this).index(), 1000, false) }); }, } indexFn.init(); });