var dottarget = null; var dotindex = 0; var jhbannerswiper = new swiper('#jh-index-banner', { on: { init: function () { swiperanimatecache(this); swiperanimate(this); // dottarget = $('.swiper-dots .dot').eq(this.activeindex) dotprogress() }, slidechangetransitionstart: function(){ dotindex = this.activeindex // dottarget = $('.swiper-dots .dot').eq(this.activeindex) dotprogress() }, slidechangetransitionend: function(){ swiperanimate(this); } }, autoplay: { delay: 6000, /* stoponlastslide: false, disableoninteraction: false, pauseonmouseenter: true */ } }); var jhwapbannerswiper = new swiper('#jh-index-wap-banner', { on: { init: function () { swiperanimatecache(this); swiperanimate(this); // dottarget = $('.swiper-dots .dot').eq(this.activeindex) dotprogress() }, slidechangetransitionstart: function(){ dotindex = this.activeindex // dottarget = $('.swiper-dots .dot').eq(this.activeindex) dotprogress() }, slidechangetransitionend: function(){ swiperanimate(this); } }, autoplay: { delay: 5000, /* stoponlastslide: false, disableoninteraction: false, pauseonmouseenter: true */ } }); var jhpartnerswiper = new swiper("#jh-partners", { slidesperview: 6, breakpoints: { 320: { //当屏幕宽度大于等于320 slidesperview: 3, spacebetween: 10 }, 768: { //当屏幕宽度大于等于768 slidesperview: 4, spacebetween: 20 }, 1280: { //当屏幕宽度大于等于1280 slidesperview: 5, spacebetween: 30 } }, pagination: { el: '.swiper-pagination', }, autoplay: { delay: 1000, stoponlastslide: false, disableoninteraction: false, pauseonmouseenter: true } }); function dotprogress() { dottarget = $('.swiper-dots .dot').eq(dotindex) // 先还原同胞元素 dottarget.siblings().each(function () { $(this).find('.pgs').css({ '-webkit-transform': 'rotate(45deg)' }) $(this).removeclass('on') }) // 当前元素动画开始 dottarget.addclass('on') } $(function () { // 全局数字滚动效果 $('.counter').countup(); });