Ver Mensaje Individual
  #2 (permalink)  
Antiguo 25/06/2013, 19:17
Avatar de freddy31DA
freddy31DA
 
Fecha de Ingreso: junio-2012
Mensajes: 84
Antigüedad: 11 años, 10 meses
Puntos: 2
Respuesta: Como cambiar la imagen al hacer click

seria algo así como cuando pasas el puntero y cuando lo quite vuelva la imagen anterior ?

Código Javascript:
Ver original
  1. <html>
  2. <head>
  3.     <title>imagen </title>
  4. </head>
  5. <script type="text/javascript">
  6.     function cambiar(){
  7.         document.getElementById("img").style.cursor="pointer";
  8.        
  9.     }
  10.  
  11.  
  12.  
  13. </script>
  14. <body>
  15.     <img id="img" src="img1.jpg" onmouseover="this.src='img2.jpg', cambiar()" onmouseout="this.src='img1.jpg'" width="200" height="100">
  16.  
  17.  
  18.  
  19. </body>
  20. </html>