Answer the question
In order to leave comments, you need to log in
How to run autoplay on hover in owl carousel?
owl has autoplayHoverPause, but I need the opposite, so that autoplay is enabled on hover, but not in the normal state.
Answer the question
In order to leave comments, you need to log in
$owl.on('mouseenter mouseleave', function(e) {
$(this).data('owl.carousel').options.autoplay = e.type === 'mouseenter';
$(this).trigger('refresh.owl.carousel');
});
$owl.on('mouseenter mouseleave', function(e) {
$(this).trigger(({
mouseenter: 'play',
mouseleave: 'stop',
})[e.type] + '.owl.autoplay');
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question