...

View Full Version : jQuery - Image gallery thumbnails problem in Safari



JasonSims
12-02-2010, 04:09 AM
Okay,

So I have an image gallery set up using AD Gallery (http://coffeescripter.com/code/ad-gallery/). I have gone in and tweaked some of the code, but mainly just CSS changes and not too many JS changes, so I am fairly positive I haven't inadvertently caused the problem.

The problem I am facing is that when the gallery is viewed in Safari, the thumbnail container ( a ul) is set to 100px width. In firefox it works correct. Basically the ul is supposed to dynamically adjust to the number of thumbnails and all the images are loaded from a directory via php.

The snippet of code out of the ad-gallery javascript that sets the width is as follows:



// Wait until all thumbs are loaded, and then set the width of the ul
var inter = setInterval(
function() {
if(thumb_count == thumbs_loaded) {
thumb_wrapper_width -= 100;
var list = context.nav.find('.ad-thumb-list');
list.css('width', thumb_wrapper_width +'px');
var i = 1;
var last_height = list.height();
while(i < 201) {
list.css('width', (thumb_wrapper_width + i) +'px');
if(last_height != list.height()) {
break;
}
last_height = list.height();
i++;
}
clearInterval(inter);
};
},
100
);
},


Any help is greatly appreciated!

harbingerOTV
12-03-2010, 03:42 PM
http://web.enavu.com/daily-tip/daily-tip-difference-between-document-ready-and-window-load-in-jquery/

have a look at that. I suspect it might be your answer.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum