jsor / jcarousel

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

Control plugin only works up to 10 items #697

Closed unaghii closed 10 years ago

unaghii commented 10 years ago

I'm using the Control plugin to control my carousel from another carousel (that uses a different plugin). It works fine until the 10th element (index 9), after that, the carousel scrolls to the first number of the given integer. Example: If I click on the element with index 25, the carousel scrolls to the third slide (index 2). I've looked through the code and haven't seen anything that would cause this.

The page where this happens is the following: http://luster.com.br/site/produtos You can reproduce the error by simply clicking on the thumbnails near the end of the page, or test it through the console with jQuery("#products-wrapper").jcarousel('scroll', index);

Thanks.

jsor commented 10 years ago

That's strange. I can reproduce this on your page, but not locally. Could you please try to create a minimal reproducible test case with everything else removed to ensure there are no other scripts influencing it?

unaghii commented 10 years ago

Sure, here it is: http://jsfiddle.net/2KVJc/

jsor commented 10 years ago

Found it: The <ul> element is simply is too small. You have defined a width of 9999px. Each item is 930px, so the 11th item wraps around and is below the first item.

unaghii commented 10 years ago

D'oh!

Cheers, man. Thanks a lot.