Ver Mensaje Individual
  #7 (permalink)  
Antiguo 26/07/2009, 02:04
Avatar de Legoltaz
Legoltaz
 
Fecha de Ingreso: agosto-2008
Mensajes: 325
Antigüedad: 15 años, 9 meses
Puntos: 6
Respuesta: jQuery: Problemas con uso de variable

¡Solucionado!

Al final el código queda así:

Código JavaScript:
Ver original
  1. $(document).ready(function(){
  2.     $("img").each(function(n){
  3.         w = $(this).width();
  4.         h = $(this).height();
  5.         $(this).attr("dims",w+","+h);
  6.     });
  7.     $("img").css({width:80,height:80});
  8.     $("img").click(function(){
  9.         d = $(this).attr("dims").split(",");
  10.         $(this).animate({width:d[0],height:d[1]},"slow");
  11.     });
  12. });

Muchas gracias por tu ayuda, eall.