Change handler and determining slides in view #6861
craig-ryan-sn
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am triggering impression events based on slides in view as the slider changes.
The swiper (react version) is loaded with looping and 'auto' slides per view. When onSlideChange fires I basically need to calculate from the swiper data: how many slides are in view? which of my items are in view?
What if the slide display is wider than the number of my items? It appears to duplicate items to fill the display. How would I perform the same calculations in this case?
I'm trying to interpret any of realIndex, activeIndex, previousIndex and slides[] but not making much sense of them. I would appreciate some pointers.
thanks!
Beta Was this translation helpful? Give feedback.
All reactions