반응형
Swiper 예제 - 첫번째 슬라이드에서 prev 기능 막기 포스팅 썸네일 이미지

JavaScript/실전

Swiper 예제 - 첫번째 슬라이드에서 prev 기능 막기

1. 기본 구조 1 2 3 4 5 6 7 Swiper에서 loop 기능을 사용하지 않으면 첫번째 슬라이드에서 prev 버튼이 자동적으로 비활성화된다. 마찬가지로 마지막 슬라이드에서 next 버튼도 비활성화된다. 한편 loop 기능을 사용하게 되면 첫번째 슬라이드에도 이전 슬라이드가 존재하고, 마지막 슬라이드 다음에도 슬라이드가 존재하기 때문에 버튼이 항상 활성화되어 있다. 말 그대로 루프(반복)니까 당연한 현상이다. 그런데 사용자에 따라서 loop 기능을 사용하되 첫번째 슬라이드에서 prev 버튼을 비활성화하고 싶을 수 있다. 첫번째 슬라이드에서 마지막 슬라이드로 되돌아가는 것이 마음에 들지 않을 수도 있으니까. 이제 해결 방법에 대해 알아보자. 2. reachBeginning, reachEnd Swip..

2021.11.06 게시됨

Swiper 예제 - 슬라이드가 넘어갈 때 이벤트 호출 포스팅 썸네일 이미지

JavaScript/실전

Swiper 예제 - 슬라이드가 넘어갈 때 이벤트 호출

swiper는 다른 라이브러리보다 직관적이고 친절한 demo와 api를 제공하고 있다. Swiper Demos Swiper is the most modern free mobile touch slider with hardware accelerated transitions and amazing native behavior. swiperjs.com Swiper API Swiper is the most modern free mobile touch slider with hardware accelerated transitions and amazing native behavior. swiperjs.com 그 중 여러가지 이벤트 메서드를 지원하는데 activeIndexChange와 slideChange는 슬라이드가 바..

2021.03.27 게시됨

반응형