N
N
nen0y2019-10-07 12:44:08
Slick
nen0y, 2019-10-07 12:44:08

How to disable the forward button on the last slide?

When the last slide is displayed, the forward arrow should become inactive . How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-10-07
@0xD34F

Set infinite: falsein the slider settings.
Well, or, if you are not looking for easy ways:

$slick.on('beforeChange', function(e, slick, currentSlide, nextSlide) {
  $(this).find('.slick-next').prop('disabled', nextSlide === slick.slideCount - 1);
});

UPD. Taken from the comments:
How can she change her style?

If infinite scrolling is disabled, then the class assigned to the buttons in the extreme positions slick-disabledcan be used to redefine their appearance.
Otherwise, proceed in the same way as in the case of blocking the button, write toggleClass instead of prop, replace disabled with the name of the class that is responsible for styling the inactive button.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question