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

How to use SwiperThumbs ? #78

Open
teenking opened this issue Aug 5, 2023 · 1 comment
Open

How to use SwiperThumbs ? #78

teenking opened this issue Aug 5, 2023 · 1 comment

Comments

@teenking
Copy link

teenking commented Aug 5, 2023

Dear Sir,
I'm a newbie.
Do you have any example for use SwiperThumbs ?
I'm stuck on it.
Please anyone help me
Thank you

@StikyFingaz
Copy link

Hello, after I lost 1/2 day on that, it seems it was simple to set it up but it requires several details in order to have a somewhat working configuration.

On your main swiper add the module and the thumbs config. The other props are optional. If you have multiple slides-per-view you need to set autoScrollOffset to some sane number, otherwise the thumbs swiper won't slide till the last slide. Main swiper:

<Swiper :modules="[SwiperThumbs]" slidesPerView="auto" :centeredSlides="true" :centeredSlidesBounds="true" :spaceBetween="10" class="main-gallery" :thumbs="{ swiper: '.nav-gallery', autoScrollOffset: 3, }" > ... </Swiper>

On your thumbs swiper you just need to add the class you set in your main swiper. Note that you also need the SwiperThumbs module on both swipers. Thumbs swiper:

<Swiper :modules="[SwiperThumbs]" slidesPerView="auto" :centeredSlides="true" :centeredSlidesBounds="true" :spaceBetween="5" :grabCursor="true" class="nav-gallery" > ... </Swiper>

That's it. However, I cannot get the CSS to work. In the demos all thumbs except the active one are dimmed/darker. Maybe this is not included in the CSS bundle? Anyway, I hope that helps.

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

2 participants