Accessing Current Slide Attributes in onAfterChange
See original GitHub issueI feel like I’m overlooking something obvious here. I’m successfully using onAfterChange
for a few things, but I can’t seem to access the attributes of the current slide in this context. I’ve tried things like:
console.log( $(this).attr('id') );
console.log( $(slide).attr('id') );
But both report undefined
, even though the slides (ie, the elements with the class slick-slide
) do have id
’s.
Any help on what I’m missing would be greatly appreciated! 😃
Thanks!
Issue Analytics
- State:
- Created 9 years ago
- Comments:16 (4 by maintainers)
Top Results From Across the Web
Slick Carousel how to get current slide as a dom or jquery ...
Arg, apologies, I found a solution on a github issue titled Accessing Current Slide Attributes in onAfterChange #411. slider refers to the carousel, ......
Read more >slick - the last carousel you'll ever need - Ken Wheeler
In slick 1.5 you can now add settings using the data-slick attribute. ... use this to get the current slide so you know...
Read more >Javascript – kenwheeler/slick how to get current slide as a dom or ...
Arg, apologies, I found a solution on a github issue titled Accessing Current Slide Attributes in onAfterChange #411. slider refers to the carousel, ......
Read more >https://www.aamu.edu/_resources/ldp/galleries/slic...
Data Attribute Settings In slick 1.5 you can now add settings using the data-slick ... of current slide set, if multiple `slidesToShow`) after...
Read more >Untitled
Slick slider get current slide index. slick-current back to being the first ... or the last Accessing Current Slide Attributes in onAfterChange #411...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@nixon1333
.attr('data-slick-index')
worked in my case.What is $slides here?
I used $(“[data-slick-index='” +currentSlide+ “']”).attr(‘id’) to get the current Slide