[Swiper] 슬라이드 index 구하기
Date.
github : https://github.com/ksoyy/LEVEL-UP/tree/main/swiper/슬라이드%20index%20구하기
codepen : https://codepen.io/ksoyy/pen/XWEjqVj
swiper 슬라이드를 사용하게 될때 응용작업에서 가장 많이 사용하고 있는 슬라이드 인덱스 구하는 방법입니다!
그냥 index를 구할때 loop 옵션과 함께 사용할경우 정확한 index 구하기가 어렵습니다.
slideChange 이벤트를 사용해 슬라이드가 변경될때 정확한 index값을 구할수있습니다.
DEMO
See the Pen Untitled by kim so yeon (@ksoyy) on CodePen.
참고