No width/height set for items. This will cause an infinite loop. Aborting

前端 未结 11 1444
太阳男子
太阳男子 2020-12-13 23:46

I am using jcarousel, and on window resizing I am getting the error:

jCarousel: No width/height set for items. This will cause an infinite loop. Abo

11条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-14 00:22

    I've just encountered this problem and neither the above, nor any other solution I found fixed the problem. If anyone's still encountering this I fixed it as follows:

    1. Upgrade to latest version of jCarousel if not already on latest.
    2. Define the itemFallbackDimension property when you create your jCarousel instance, with it set to either the height or width, depending on whether you're using jCarousel in horizontal or vertical orientation, e.g:

      jQuery('#imageScroller').jcarousel({ scroll :1, itemFallbackDimension:588 });

    Hopefully that will help you as it did me.

提交回复
热议问题