Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
690 views
in Technique[技术] by (71.8m points)

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

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. Aborting...

How can I avoid this error?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...