Last active
March 2, 2022 11:35
-
-
Save nikola0203/706fede2cb0921747dee82bfcb9b6d0e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'swiper/css' | |
import 'swiper/css/navigation' | |
import Swiper, { Navigation, Pagination } from 'swiper'; | |
$(".swiper-container").each(function(index, element){ | |
$(this).addClass("swiper-container-" + index); | |
$(this).find(".swiper-button-prev").addClass("swiper-button-prev-" + index); | |
$(this).find(".swiper-button-next").addClass("swiper-button-next-" + index); | |
new Swiper(".swiper-container-" + index, { | |
modules: [Navigation, Pagination], | |
slidesPerView: 2, | |
spaceBetween: 30, | |
navigation: { | |
nextEl: ".swiper-button-next-" + index, | |
prevEl: ".swiper-button-prev-" + index, | |
}, | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment