Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/04/2012, 08:10
Avatar de oscartt67
oscartt67
 
Fecha de Ingreso: abril-2012
Ubicación: fonollosa
Mensajes: 481
Antigüedad: 12 años
Puntos: 97
Esperar que attr(src,x) termine

Hola a todos.
Tengo el siguiente problema:

el flujo de ejecucion no espera a que attr termine de cargar la imagen: lo hace durante la animacion. Si pongo un alert(1) despues de im.attr, todo va perfectamente.
Se puede usar callback con attr? (lo probé, sin resultados)
Alguna sugerencia?
Gracias de antemano.


Código PHP:
        ......
        
im.attr("src",$(this).attr("href"));
        
im.css({
            
position'absolute',
            
leftimgxica.offset().left,
            
topimgxica.offset().top,
            
widthevent.target.width,
            
heightevent.target.height
        
});
        
im.animate({left:posfi.left,top:posfi.top,width:700,height:400},400);