Answer the question
In order to leave comments, you need to log in
How to count slides one at a time while slick is set to slidesToScroll: 4?
Now the slider scrolls 4 slides at a time and naturally counts the scrolling as 1.5, and so on. The buttons on the slick are custom and the block with the output of the number of slides and the current slide are also custom.
Below is one solution but it doesn't always work.
How else can you implement this functionality on a slick? So that when scrolling through 4 slides at a time, write 1/10, 2/10, 3/10, etc.
var total_1 = $('.slider_product_js_tab_2 .slick-slide:not(.slick-cloned)').length / 4;
$('.wrapper_arrow_tab_2 .total').text(Math.ceil(total_1));
$('.slider_product_js_tab_2').on('afterChange', function (event, slick, currentSlide, nextSlide) {
$('.wrapper_arrow_tab_2 .current').text(currentSlide / 4 + 1);
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question