jsor / jcarousel

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

JCarousel sometimes is offcentered #756

Closed andrewyang96 closed 9 years ago

andrewyang96 commented 9 years ago

When I deployed a website with a jCarousel plugin, I found that jCarousel sometimes glitched. The jCarousel seemed to initialize before the images were loaded and I would start with half an image and an incorrect number of slide buttons. Here's a screenshot:

jCarousel glitch

Can anyone figure this out? Thanks!

jsor commented 9 years ago

The problem is, that you don't set a width for your carousel items. jCarousel can only calculate correctly once all images loaded. You can try to reload the carousel on window.load or (use something like imagesloaded).