SwiperEffectCoverflow - swiperSlideOffset: NaN in slides
mobius77 opened this issue · 0 comments
mobius77 commented
I'm trying use SwiperEffectCoverflow module, but there is no effect.
<Swiper
:modules="[SwiperEffectCoverflow]"
id="daySwiper"
:direction="'vertical'"
:effect="'coverflow'"
:coverflowEffect="{
rotate: -35,
stretch: -5,
depth: 105,
scale: 1,
modifier: 1,
slideShadows: false,
}"
:slides-per-view="'5'"
:centeredSlides="true"
:grabCursor="true"
class="mySwiper"
>
<SwiperSlide v-for="day in days" :key="day.index" >{{day}}</SwiperSlide>
</Swiper>
It's because: swiperSlideOffset: NaN in slides....
in file effect-coverflow.mjs in loop: for (let i = 0, length = slides.length; i < length; i += 1) {
I don't understand why
If i change:
const slideOffset = slideEl.swiperSlideOffset;
to:
const slideOffset = slideEl.swiperSlideIndex * slideSize;
everything works fine...
This problem only occurs if the slider is hidden when the page is displayed, and then shown on some event.