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: false, 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(); });