updateSlidesOffset.js 326 B

1234567891011
  1. export default async function updateSlidesOffset() {
  2. const swiper = this;
  3. const slides = swiper.slides;
  4. for (let i = 0; i < slides.length; i += 1) {
  5. let offset = (slides[i].swiperSlideSize + swiper.params.spaceBetween) * slides[i].index;
  6. slides[i].swiperSlideOffset = swiper.isHorizontal() ? offset :
  7. offset;
  8. }
  9. }