Answer the question
In order to leave comments, you need to log in
How to link navigation to an image?
Good afternoon.
The project uses OwlCarousel 2.х.х.
The question is how to bind the functions of the navigation buttons back and forth to custom images.
I tried to do it like this (I found such a solution on one site, but apparently I’m not using it correctly - it doesn’t work):
$(document).ready(function(){
$('.owl-carousel').owlCarousel({
items: 1,
loop: true,
autoplay: true,
smartSpeed: 1000,
nav: false,
dots: false,
}
);
$(".next-image").click(function() {
owl_review.trigger('owl.next');
});
$(".prev-image").click(function() {
owl_review.trigger('owl.prev');
});
});
Answer the question
In order to leave comments, you need to log in
$(document).ready(function(){
var owl_review = $('.owl-carousel');
owl_review .owlCarousel({
items: 1,
loop: true,
autoplay: true,
smartSpeed: 1000,
nav: false,
dots: false,
}
);
$(".next-image").click(function() {
owl_review.trigger('owl.next');
});
$(".prev-image").click(function() {
owl_review.trigger('owl.prev');
});
});
$('.prev-image').click(function(){
$('.owl-carousel').trigger('prev.owl.carousel', [300]);
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question