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

前端 未结 11 1440
太阳男子
太阳男子 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:07

    Just provide the option 'itemFallbackDimension'

    Example:

    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.

    I hope this helps someone...

提交回复
热议问题