JasonSims
12-02-2010, 03: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!
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!