No width / height for elements. This will cause an endless loop. Aborting

I use jcarousel, and when I resize the window, I get an error:

jCarousel: for elements there is no width / height. This will lead to an endless loop. Aborting ...

How to avoid this error?

+44
jquery jcarousel
Sep 24 '10 at 7:12
source share
11 answers

Just put the option 'itemFallbackDimension'

Example:

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

If for any reason jCarousel cannot determine the width of the element, you can set a fallback dimension here (width or height, depending on orientation) to ensure correct calculations.

I hope this helps someone ...

+96
May 05 '11 at 9:34 a.m.
source share

This error appears when the linked css file is not connected or incorrectly connected ... you must apply it correctly (skin name goes into identifier or ul). Example: ul class must be installed on jcarousel-skin-tango or on jcarousel-skin-ie7

+16
Mar 04 2018-12-12T00:
source share

I just ran into this problem, and neither the above nor any other solution I found fixed the problem. If someone is still facing this, I fixed it as follows:

  • Upgrade to the latest version of jCarousel if it is not the latest.
  • Define the itemFallbackDimension property when creating an jCarousel instance with its height or width setting, depending on whether you use jCarousel in horizontal or vertical orientation, for example:

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

Hope this helps you as I do.

+10
Apr 11 '11 at 15:57
source share

This is by design, you must set the width and height of each image:

 <li><img src="" width="75" height="75" alt="" /></li> 
+4
Sep 24 '10 at 7:37
source share

You need to set the height and width on ul or in any container where the images are stored. Check out the css that comes with jCarousel (it's long, but only the first few rules matter).

+2
01 Oct '10 at 15:05
source share

we got this error when the carousel was in an iframe on an external site.

none of the answers above helped, and we only had a packaged version of the jcarousel plugin. so we just did the following (via the inmoon response line):

instead of "isNan" we replaced the keyword "alert" in the source code with the new function name ("myFunc"). then we created this function:

 myFunc = function(myParam) {return} 

this fixed a mistake.

now i know this is a dirty hack but it seems to have helped

+1
Mar 01 '13 at 13:43 on
source share

I observe this problem if the container gallery is hidden: none

+1
Aug 28 '13 at 11:54 on
source share

You just need to upgrade jcarousel to the latest version. And that will solve the problem.

Download the latest version here and update the necessary files.

+1
Aug 30 '14 at 17:42 on
source share

If your gallery is inside UpdatePanel (Ajax), this will not work if you created an event inside the panel. every thing inside the panel stops or generates an error ....

0
Aug 26 '13 at 21:30
source share

just put "~ / Content / Carouselcss / skin.css" in the right place.

0
Jan 26 '16 at 6:05
source share

SOLUTION: Not sure if this is really a solution or a workaround, but it does the job of expanding the nagging popup window once and for all (with the jCarousel function enabled).

  • Open jquery.jcarousel.pack.js in ../jcarousel/lib/ directory .

  • Pay attention to the word "warning" and you should find the code snippet as follows: Aborting|loop|infinite|an|cause|will|This|items|set|No|jCarousel|alert|class|

  • Replace "alert" with "isNan": Aborting|loop|infinite|an|cause|will|This|items|set|No|jCarousel|isNan|class|

  • Refresh the web page loading jCarousel and you will no longer be able to get an infinite loop pop-up error!

-one
Feb 28 '12 at 12:55
source share



All Articles