jCarousel Infinite Loop - no width or height set

匿名 (未验证) 提交于 2019-12-03 10:10:24

问题:

I've setup jcarousel to dynamically load elements as they disappear and then have them reappear

now it's given me an error saying: "No width/height set for items."

I've tried the hack described here: http://old.nabble.com/jCarousel:-No-width-height-set-for-items.-td13913308s27240.html

and it caused firefox to crash (probably because it's looping constantly)

any ideas?

回答1:

You need to set an explicit height on the .jcarousel-clip container



回答2:

jQuery('#mycarousel').jcarousel( {     auto : 2,     scroll : 1,     wrap : 'last',     initCallback : mycarousel_initCallback,     itemFallbackDimension: 300 });


回答3:

So ignore my comment response to @TALLBOY. I was able to fix this issue by specifying a width for div.carousel-container which is an element that is added by the code when the carousel is initialized.

I stumbled across this during my searches:

http://github.com/jsor/jcarousel/issuesearch?state=open&q=width#issue/22



回答4:

Guys this should work

.jcarousel-list li { height:??px; width: ??px; }

When you put your height and width in, in your css file it should appear.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!