jQuery jCarouselLite, or its jQuery UI counterpart, not showing up on page load

30th November, 2009, 0 About the author
Ben Vallack is a web developer and filmmaker.

Tags: jquery, javascript, bug, jcarousellite

The problem: 
A jQuery jCarouselLite or jQuery UI Carousel appears to not show on an initial page load, but does show up on subsequent page loads.

The solution:
Give image elements inside the carousel list items their width and height through attributes or css.

The reason:
I assume this is to do with the carousel running on 'document.ready' and not knowing the dimensions of images inside the carousel and therefore applying a 0x0 size to the carousel.  It works on subsequent page loads because the images are cached and their sizes known. 

Comments RSS

    There are no comments yet. Be the first to add a comment by using the form below.