beforeChange (and afterChange) bubble
See original GitHub issuehttp://jsfiddle.net/L1c949zf/1/
In the following setup, where each slide of .slider
contains its own .sub-slider
, currentSlide
is logged to the console whenever either slider changes.
$(".slider").slick({
autoplay: true,
autoplaySpeed: 4000,
dots: true
});
$(".sub-slider").slick({
autoplay: true,
autoplaySpeed: 1000,
dots: false,
arrows: false
});
$(".slider").on('beforeChange', function(event, slick, currentSlide) {
console.log(currentSlide);
});
The only way I can think, currently, to ensure that it’s the .slider
element that has changed is something like
$(".slider").on('beforeChange', function(event, slick, currentSlide) {
if ($(slick.$slider).hasClass('slider')) {
console.log(currentSlide);
}
}
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Slick carousel Slider Syncing beforechange/afterchange ...
I want the carousel to do some functions on afterchange & beforechange callbacks. The problem is that I don't want those functions to...
Read more >slick carousel current slide after change Code Example
$('.your-element').on('beforeChange', function(event, slick, currentSlide, nextSlide){. 2. console.log(nextSlide);. 3. }); Source: kenwheeler.github.io.
Read more >HTMLElement: change event - Web APIs | MDN
The change event is fired for , , and elements when the user modifies the element's value. Unlike the input event, the change...
Read more >Autobinding sumproduct - Database - Bubble Forum
Sounds like you can use a database trigger with a strict contraints of “Product's price before change is not product's price after change”...
Read more >#4 Slick callback + адаптивность / afterChange,beforeChange,init ...
#4 Slick callback + адаптивность / afterChange,beforeChange,init, responsive... 208 views208 views ... Bubble Responsive Design Crash Course. Matt Neary.
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 also cancel the bubble in a listener on the sub slider
You can check the target to differentiate