[jQuery] [jCarousel] resizing slow with a fluid height
Hey,
I'm using the jCarousel to fill a page vertically, while the remains
fixed. In order to do this I wrote a function that gets the height of
the browser window and then sets the height of the carousel to the
browser.
var getHeight;
function setCarouselHeight() {
getHeight = 0;
if ($.browser.opera){
getHeight = window.innerHeight;
}else{
getHeight = $(window).height();
}
getHeight = getHeight - 37; //extra padding for carousel buttons/
chrome
$(".jcarousel-container-vertical").height(getHeight);
$(".jcarousel-clip-vertical").height(getHeight);
}
I then call this function on init and reload:
$(document).ready(function() {
$("#smartbar").jcarousel({
vertical: true,
scroll: 1,
initCallback: setCarouselHeight,
reloadCallback: setCarouselHeight
});
});
The problem I'm facing is that when loading or resizing the smartbar
takes 3-4 seconds to load.
I've got an example set up here: http://resourceserver.org/jcarousel/
I've narrowed it down to a height:auto issue with .jcarousel-item but
I'm not sure. Would really appreciate any help.