Slick Carousel: http://kenwheeler.github.io/slick/
How can I get the element of the slide in an event? For example:
.on('afterChange', function (slick, currentSlide)
{
var currentSlideElement = //Get current slide element here
});
The first argument seems to be the event
object, but its target
(or currentTarget
) is always the slides container, and second argument seems to be the slick object....
currentSlide
returns a number, and then I can select the element via thedata-slick-index
attribute, e.g.$("[data-slick-index='"+currentSlide+"']);
. – Reprehensible