Add onClick callback for slides
See original GitHub issueAdd onClick callback (optional) for when individual slides are clicked…
I’m basically achieving this right now by registering a click handler for each slide in the onInit
callback:
onInit: function(slick){
slick.$slides.each(function(index, slide){
console.log('slide #' + index + ' has been clicked!');
});
}
This seems to work, but it would be nice if there was an easier way to achieve this…
Issue Analytics
- State:
- Created 9 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
JavaScript - href vs onclick for callback function on Hyperlink
I have a webform where the user can add and remove items and I put the onclick in the href of the links...
Read more >Click Events - Embla Carousel
Adding click events to your slides with React is straightforward. We'll create a onSlideClick function wrapped in a useCallback and add that click...
Read more >Simple Triggers | Apps Script - Google Developers
Triggers let Apps Script run a function automatically when a certain event, like opening a document, occurs. Simple triggers are a set of...
Read more >View.OnClickListener - Android Developers
android.app.appsearch.observer. Overview. Interfaces. ObserverCallback. Classes. DocumentChangeInfo · ObserverSpec · ObserverSpec.Builder · SchemaChangeInfo.
Read more >ASP.NET Core Blazor event handling - Microsoft Learn
Wire up the custom event with the event arguments by adding an ... <p> <button @onclick="OnClickCallback"> Trigger a Parent component method ...
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
You can do this like:
This works well $(‘#slider_co .slick-slide’).on(‘click’, function (e){ let slideClicked = $(e.currentTarget).attr(“data-slick-index”); console.log(slideClicked); });