Slick Carousel: http://kenwheeler.imtqy.com/slick/
How can I get a slide element in an event? For instance:
.on('afterChange', function (slick, currentSlide) { var currentSlideElement = //Get current slide element here });
The first argument is an event object, but its target (or currentTarget ) is always a container of slides, and the second argument seems to be a smooth object ....
event
target
currentTarget
you need to include the first argument to "event" like this
$('.your-element').on('afterChange', function(event, slick, currentSlide){ console.log(currentSlide); });
otherwise your currentSlide argument will be "slick"
To get the DOM element in the afterChange event:
$('.your-element').on('afterChange', function (event, slick, currentSlide) { var elt = slick.$slides.get(currentSlide); });
// Get the current slide var currentSlide = $('.your-element').slick('slickCurrentSlide');
Source: https://github.com/kenwheeler/slick
Source: https://habr.com/ru/post/983973/More articles:Android: How to make a circular view of the camera? - androidSplit text based on point in R - regexhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/983970/passing-r-functions-to-c-as-c-functions&usg=ALkJrhjvyS1WUcOB4K347uoYLPOJXeooBwHow to pass information to a Python daemon? - pythonSymfony2: Doctrine "could not find driver" - mysqlhover style cannot be applied when mouse clicks in chrome - cssHow to make page tab transitions in Ionic Framework - javascriptProlog - no arguments are created - prologWhy do we use '!' in the prologue - prologHow to create a prediction interval from the rpart object of a regression tree? - rAll Articles