Hola descargué un script para una galeria y tengo un problema al mostrar los thumbnails, la parte del script que no cuadra es esta:
Código PHP:
thumbs.each(
function(i) {
var link = $(this);
var image_src = link.attr('href');
var thumb = link.find('img');
// Check if the thumb has already loaded
if(!context.isImageLoaded(thumb[0])) {
thumb.load(
function() {
thumb_wrapper_width += this.parentNode.parentNode.offsetWidth;
thumbs_loaded++;
}
);
}else{
alert(thumb[0].parentNode.parentNode.offsetWidth);
thumb_wrapper_width += thumb[0].parentNode.parentNode.offsetWidth;
thumbs_loaded++;
};
etc...
Lo que pasa es esto alert(thumb[0].parentNode.parentNode.offsetWidth); siempre me devuelve 0, y ya cheque que la imagen ya ha sido cargada, por lo que entiendo que ya podria obtener el offsetWidth, pero me devuelve 0, alguien sabe porque puede ser esto?