Ver Mensaje Individual
  #2 (permalink)  
Antiguo 17/04/2009, 12:01
Avatar de Adler
Adler
Colaborador
 
Fecha de Ingreso: diciembre-2006
Mensajes: 4.671
Antigüedad: 17 años, 4 meses
Puntos: 126
Respuesta: seleccionar imagenes

Hola

Prueba esto
Código javascript:
Ver original
  1. var estado = false;
  2.  
  3. imagenInicial = new Image(100,100);
  4. imagenOn = new Image(100,100);
  5. imagenClick = new Image(100,100);
  6.  
  7. imagenInicial.src = "imagen1";
  8. imagenOn.src = "imagen2";
  9. imagenClick.src = "imagen3";
  10.  
  11. function over( )
  12. {
  13. if(estado == false)
  14. {
  15. document.ejemplo.src = imagenOn.src;
  16. }
  17. else
  18. {
  19. return;
  20. }
  21. }
  22.  
  23. function out( )
  24. {
  25. if(estado == false)
  26. {
  27. document.ejemplo.src = imagenInicial.src;
  28. }
  29. else
  30. {
  31. return;
  32. }
  33. }
  34.  
  35. function click( )
  36. {
  37. if(estado == false)
  38. {
  39. document.ejemplo.src = imagenClick.src;
  40. estado = true;
  41. }
  42. else
  43. {
  44. document.ejemplo.src = imagenInicial.src;
  45. estado = false;
  46. }
  47. }

Código html:
Ver original
  1. <a href="#" onmouseout="out();" onmouseover="over();" onclick="click();return false;"><img name="ejemplo" src = "imagen1" ></a>

Suerte
__________________
Los formularios se envían/validan con un botón Submit
<input type="submit" value="Enviar" style="background-color:#0B5795; font:bold 10px verdana; color:#FFF;" />