Ver Mensaje Individual
  #5 (permalink)  
Antiguo 25/07/2009, 21:46
Avatar de eall
eall
 
Fecha de Ingreso: noviembre-2008
Ubicación: Concepcion
Mensajes: 127
Antigüedad: 15 años, 6 meses
Puntos: 8
Respuesta: jQuery: Problemas con uso de variable

Ya entendí lo que quieres hacer.

Guarda en un atributo las dimensiones originales y cuando le hagas clic las rescatas y las cambias.

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

pruebalo y me dices como te fue.
__________________
tutoriales xajax, jQuery, PHP y otros en mi blog