<!-- playground-->
<script>
const sliderEl = document.querySelector(".blaze-slider");
const blazeSlider = new BlazeSlider(sliderEl, {
all: {
enableAutoplay: true,
autoplayInterval: 15000,
slidesToScroll: 6,
slidesToShow: 6,
transitionDuration: 300,
loop: true
},
"(max-width: 900px)": {
slidesToShow: 2,
slidesToShow: 2,
slidesGap: "40px"
},
"(max-width: 500px)": {
slidesToShow: 1,
slidesToScroll: 1
}
});
// listen for slide event
blazeSlider.onSlide(
(pageIndex, firstVisibleSlideIndex, lastVisibleSlideIndex) => {
console.log({
pageIndex,
firstVisibleSlideIndex,
lastVisibleSlideIndex
});
}
);
</script>
<!-- playground-->
<script>
const sliderEl = document.querySelectorAll(".blaze-slider").forEach(sliderEl => {
const blazeSlider = new BlazeSlider(sliderEl, {
all: {
enableAutoplay: true,
autoplayInterval: 15000,
slidesToScroll: 6,
slidesToShow: 6,
transitionDuration: 300,
loop: true
},
"(max-width: 900px)": {
slidesToShow: 2,
slidesToShow: 2,
slidesGap: "40px"
},
"(max-width: 500px)": {
slidesToShow: 1,
slidesToScroll: 1
}
});
// listen for slide event
blazeSlider.onSlide(
(pageIndex, firstVisibleSlideIndex, lastVisibleSlideIndex) => {
console.log({
pageIndex,
firstVisibleSlideIndex,
lastVisibleSlideIndex
});
}
);
})
</script>