Monday, March 18, 2013

Fix "No width/height set for items. This will cause an infinite loop." on jCarousel

Fix "No width/height set for items. This will cause an infinite loop." on jCarousel
If you get this error :
jCarousel: No width/height set for items. This will cause an infinite loop.

that mean you use jCarousel Plugin, so just provide the option 'itemFallbackDimension'

Here exemple :
jQuery('#yourcarousel').jcarousel({
scroll: 1,
visible: 1,
animation: 3000,
auto: 8,
wrap: 'circular',
itemFallbackDimension: 300
});

If, for some reason, jCarousel can not detect the width of an item, you can set a fallback dimension (width or height, depending on the orientation) here to ensure correct calculations.
Disqus Comments