jsor / jcarousel

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

List size keeps growing while it should get smaller #63

Closed tdolsen closed 13 years ago

tdolsen commented 14 years ago

I've set up a carousel with 10 elements, using the following options:

When scrolling beyond the 10 elements, the list/ul grows in width, to compensate for the 2 new items that has to be added i guess. If I continue to scroll the list will keep growing in width (to compensate for new elements). But it should only have to compensate for maximum of ((10 * (wrapper width / 4)) + x), where x is 6 while animating and 4 while paused.

Well this would be OK (not optimal), as long as the size would shrink when scrolling backwards. However, the size actually keeps growing, even while stepping back.

I'm not sure if this is related to issue #45, but that's how i found the bug.

Both Firefox 3.6.10 and Chrome 6.0.472.63 are affected. I don't have the opportunity to give an example at the moment, but I'm guessing this should be fairly easy to reproduce. If not; let me know and I'll upload the code.

I have tested HEAD and 0.2.7, both with the same result.

jsor commented 14 years ago

Yep, i have to admit that circular wrapping is buggy at the moment. jCarousel was never intended to work with wrap:circular because of a lot of problems caused by its nature and architecture.

I'm still in the process of thinking about a solution for all the different setups.

dorgan commented 13 years ago

I find this happens when you do not have .jcarousel-clip-horizontal defined in your css. I have a couple of auto scrolling carousels set to wrap: 'circular' and once I defined that in the css everything works perfect and it cleans up after itself

scottfinkelstein commented 13 years ago

I just ran into this issue myself. How did you define '.jcarousel-clip-horizontal?' Did you just add it with empty braces to the CSS? I tried that without any luck.

sparky672 commented 13 years ago

@jsor, I also use a scrolling ticker (slightly different than a carousel in that it smoothly scrolls continuously) but it wraps circular.

It only clones a few of the items based on width and then simply repeats itself.

Example: I have 10 items but only 4 are visible across the scroll width. It just clones the first 4 items and adds them to the end of the list- that's all. When it wraps around, you're looking at the clones but as soon as it reaches starting position, it is seamlessly replaced with the originals. Then 14 items scroll indefinitely in a loop. Nothing more is created or destroyed.

Perhaps their looping method is adaptable to jCarousel.

http://logicbox.net/jquery/simplyscroll/horizontal.html