Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SwiperEffectCoverflow - swiperSlideOffset: NaN in slides #108

Open
mobius77 opened this issue Nov 27, 2023 · 0 comments
Open

SwiperEffectCoverflow - swiperSlideOffset: NaN in slides #108

mobius77 opened this issue Nov 27, 2023 · 0 comments

Comments

@mobius77
Copy link

mobius77 commented Nov 27, 2023

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.

@mobius77 mobius77 changed the title SwiperEffectCoverflow SwiperEffectCoverflow - swiperSlideOffset: NaN in slides Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant