How to programmatically add a thumbs slider to another slider when both sliders have already been initialized? #6869
Unanswered
Chaitanya-Raj
asked this question in
Q&A
Replies: 1 comment
-
You can add it to the main swiper at runtime like this: mainSwiperInstance.params.thumbs = {
swiper: thumbsSwiperInstance
} Hope this helps! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
According to the docs, the way to add a thumbs slider to another slider is to provide the swiperInstance of the thumb slider to the params while initializing the slider.
How can a thumbs slider be added to a slider when both of the sliders have already been initialized?
I have tried following the same method as linking the two sliders i.e. slider1.thumbs.swiper = slider2.
When doing this, the sliders are linked together, but clicking on the thumbs slider does not move either the active slide or the other slider.
Link to a CodeSandbox showing the issue: https://codesandbox.io/p/sandbox/swiper-thumbs-gallery-forked-kqflj2?file=%2Findex.html%3A199%2C36
Beta Was this translation helpful? Give feedback.
All reactions