Ver Mensaje Individual
  #8 (permalink)  
Antiguo 22/11/2014, 02:50
Avatar de marlanga
marlanga
 
Fecha de Ingreso: enero-2011
Ubicación: Murcia
Mensajes: 1.024
Antigüedad: 13 años, 3 meses
Puntos: 206
Respuesta: usar la misma funcion mas de 1 vez

Código HTML:
Ver original
  1. <img onclick="big_img(this);" id="img-p" src='$1' title="Click para ver">

Código Javascript:
Ver original
  1. function big_img(img){
  2.       if(img.style.maxWidth=="400px"){
  3.       img.style.maxWidth="120px";
  4.       }else{
  5.       img.style.maxWidth="400px";
  6.       }
  7.      
  8.  
  9.       }
Código idéntico, pero usando "this".

PD. Releyendo, ésto ya te lo han dicho.