jsor / jcarousel

Riding carousels with jQuery.
https://sorgalla.com/jcarousel/
MIT License
2k stars 734 forks source link

Bug: jcarousel target/scroll values greater than 1 do not work until 3rd click #740

Closed winonatong closed 9 years ago

winonatong commented 9 years ago

I have set up an example of the issue I'm seeing here: http://jsfiddle.net/3nw360zy/

When I click the forward arrow (>) , on the first click, scroll/target +=9 does nothing. On the second click, scroll/target +=9 only increments by 1. On the 3rd click, scroll/target +=9 finally scrolls the carousel by 9 items.

I would like the forward arrow to increment by 9 starting on the first click.

I have tried this syntax: $('.jcarousel-control-next').jcarouselControl({ target: '+=9' }); as well as this: $('.jcarousel-control-next').click( function(){ jcarousel.jcarousel('scroll', '+=9'); } );

Both have the same behavior. Am I doing something wrong here?

jsor commented 9 years ago

You have a left: 8px !important; style on .jcarousel ul which overwrites the style set by jCarousel.

winonatong commented 9 years ago

Thanks for catching that stupid mistake!