没有为项目设置宽度/高度.这将导致无限循环.堕胎 [英] No width/height set for items. This will cause an infinite loop. Aborting

查看:105
本文介绍了没有为项目设置宽度/高度.这将导致无限循环.堕胎的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jcarousel,并且在调整窗口大小时出现错误:

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

jCarousel:未为项目设置宽度/高度.这将导致无限 环形.正在中止...

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

如何避免此错误?

推荐答案

只需提供选项'itemFallbackDimension'

Just provide the option 'itemFallbackDimension'

示例:

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

如果jCarousel由于某种原因无法检测到项目的宽度,则可以在此处设置后备尺寸(宽度或高度,取决于方向),以确保计算正确.

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

这篇关于没有为项目设置宽度/高度.这将导致无限循环.堕胎的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆