在下来刷新时,banner轮播图播放混乱:

添加判断

if(this.mySwiper.activeIndex){ this.mySwiper.destroy(true,false);//这句是关键,销毁有swiper上的事件,但是保存样式 } setTimeout(function(){ mySwiper = new Swiper('.swiper-container',{ loop: length>1 ?true:false, sapceBetween:30, centerdSlides:true, runCallbacksOnInit:true, on:{ }, autoplay:{ delay:2000, disableOnInteraction:false }, pagination:{ el:'.swiper-pagination', callback:true } }) },200)

相关文章:

  • 2022-12-23
  • 2022-02-07
  • 2021-11-22
  • 2021-11-22
  • 2022-01-03
  • 2021-04-07
  • 2021-12-26
  • 2021-06-11
猜你喜欢
  • 2022-12-23
  • 2021-07-01
  • 2021-12-29
  • 2022-12-23
  • 2022-01-27
  • 2021-11-17
  • 2021-08-25
相关资源
相似解决方案