andreu
andreu

Reputation: 115

Change jCarousel direction

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

Answers (5)

msoa
msoa

Reputation: 1349

After doing these guidelines

Change li direction to right:

.jcarousel li {
    float: right;
}

Upvotes: 1

Satyanarayana
Satyanarayana

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

egbrad
egbrad

Reputation: 2417

You have to set rtl: true in the options.

(rtl stands for Right-to-Left, and defaults to false)

Upvotes: 0

kingkode
kingkode

Reputation: 2220

have you tried to add wrap: 'last', to your initialization? see here

Upvotes: 1

thecodeparadox
thecodeparadox

Reputation: 87073

You can try with the option scroll: -1.

Upvotes: 1

Related Questions