最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

vue.js - Jumping spacebetwen when initialize - Stack Overflow

programmeradmin5浏览0评论

How i can solve this?

While the slider is initializing the slides have no spaces

and after initialization they appear and the result is an ugly jump

I tried to set additional indents via CSS as a fallback but then somehow the coordinates for the slideNext slidePrev methods are calculated incorrectly

const defaultSettings: SwiperOptions = {
    spaceBetween: 16,
    slidesPerView: 'auto',
}

How i can solve this?

While the slider is initializing the slides have no spaces

and after initialization they appear and the result is an ugly jump

I tried to set additional indents via CSS as a fallback but then somehow the coordinates for the slideNext slidePrev methods are calculated incorrectly

const defaultSettings: SwiperOptions = {
    spaceBetween: 16,
    slidesPerView: 'auto',
}
Share Improve this question asked Mar 20 at 18:48 DmitriyDmitriy 1077 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

Apply gap to .swiper-wrapper until .swiper is initialized:

.swiper {
  &:not(.swiper-initialized) {
    .swiper-wrapper {
      gap: 16px;
    }
  }
}
发布评论

评论列表(0)

  1. 暂无评论