Function works incorrectly in version 2.1.0
If to establish autoplayHoverPause:true
Version 2.0.0-beta.2.4
http://www.owlcarousel.owlgraphic.com/demos/autoplay.html - works correctly
Version 2.1.0
http://owlcarousel2.github.io/OwlCarousel2/demos/autoplay.html - Autoplay doesn't renew
Same issue found and trying to resolve.
Here is a temporary fix:
$('.owl-carousel .owl-item').on('mouseenter',function(e){
$(this).closest('.owl-carousel').trigger('stop.owl.autoplay');
})
$('.owl-carousel .owl-item').on('mouseleave',function(e){
$(this).closest('.owl-carousel').trigger('play.owl.autoplay',[500]);
})
@despecial: Thank you. This work for me.
@despecial Hmm that didn't work for me.
Depends on your version of the script and code implementation.
See #1942
$(document).ready(function () {
var owl = $('.owl-carousel');
owl.on('mouseleave', function (e) {
var data = $(e.currentTarget).data('owl.carousel');
//console.log('autoplay:' + data.settings.autoplay + ' autoplayTimeout' + data.settings.autoplayTimeout);
if (data.settings.autoplay) {
$(e.currentTarget).trigger('stop.owl.autoplay');
$(e.currentTarget).trigger('play.owl.autoplay', data.settings.autoplayTimeout);
//console.log('It is working autoplay:' + data.settings.autoplay + ' autoplayTimeout' + data.settings.autoplayTimeout);
}
});
});
Most helpful comment
Here is a temporary fix: