其实就是ajax加载的问题呀,看了很多,终于自己总结出来了  ,让页面的HTML先加载,再去加载swiper

setTimeout(() => {
var swiper = new Swiper('.swiper-container', {
initialSlide :0,   //让开始第一个,官网文档有
direction : 'vertical',
slidesPerView: 4,
navigation: {
nextEl: ' .swiper-button-next',
prevEl: '.swiper-button-prev',
},
observer:true,
observeParents:true
});

$(".swiper-wrapper").css('transform','translate3d(0px, 0px, 0px)');   //从一开始的位置问题
},1)

相关文章:

  • 2021-07-13
  • 2022-12-23
  • 2022-01-04
  • 2021-05-15
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-25
  • 2022-12-23
  • 2021-07-03
  • 2022-12-23
相关资源
相似解决方案