Answer the question
In order to leave comments, you need to log in
How to scroll Owl.Carousel to clicked slide?
There is a regular Owl/Carousel on the site.
How, when clicking on the previous slide or the next one from the current one, scroll to it?
Answer the question
In order to leave comments, you need to log in
The solution may be useful to someone
var $owl = $('DOM Element');
$owl.children().each( function( index ) {
$(this).attr( 'data-position', index ); // NB: .attr() instead of .data()
});
$(document).on('click', '.owl-item>div', function() {
$owl.trigger('to.owl.carousel', $(this).data( 'position' ) );
});
Alternatively, I would make an invisible block with a left and right button and place it as you indicated using styles, and that's it
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question