Reputation: 115
I have a jCarousel implemented with the auto slide mode activated. I want to invert the direction of the movement when I arrive to a concrete slide number. In other words, the carousel is going to the right and I want it to go back (to the left) when the index of the slide is 5. I can get the index of the slide and launch a function when it's five, but I don't know how to make it go back.
Do you know if it's possible?
Thanks in advance!
Upvotes: 2
Views: 2201
Reputation: 139
//From Left to Right
$('.jcarousel').jcarouselAutoscroll({
target: '-=1'
});
//From right to Left
$('.jcarousel').jcarouselAutoscroll({
target: '+=1'
});
=1
indicates position of slide and -/+
sign indicates direction.
Upvotes: 2
Reputation: 2417
You have to set rtl: true
in the options.
(rtl stands for Right-to-Left, and defaults to false)
Upvotes: 0