Hola tengo la suiguente duda:
Tengo una imagen y quiero que cuando se haga onMouseOut cambie la imagen, al hacer onMouseover vuelva a la imagen del inicio y al hacer onMouseDown permanezca la segunda imagen aunque quites el cursor de la imagen. Éste es el código que tengo, pero no me lo hace correctamente, cada vez que quito el cursor de encima vuelve a la imagen del principio:
Código HTML:
<img onMouseOver="imagen_a()" onMouseOut="imagen_0()" onMouseDown="inicio()">
function inicio()
{
window.frames["contenido2"].location.href = "inicio2.htm";
document.getElementById('banner').src='img/imagenes/banner.gif';
document.getElementById('imagen').src='img/mapa1.gif';
}
function imagen_0()
{
document.getElementById('imagen').src='img/mapa.gif';
document.getElementById('flecha1').src='img/imagenes/flecha.gif';
document.getElementById('flecha2').src='img/imagenes/flecha.gif';
fintextointermitente();
window.frames["contenido"].location.href = "inicio.htm";
}
function imagen_a()
{
document.getElementById('imagen').src='img/mapa1.gif';
inter();
window.frames["contenido"].location.href = "inicio_a.htm";
document.getElementById('flecha1').src='img/imagenes/flecha_b.gif';
document.getElementById('flecha2').src='img/imagenes/flecha_b.gif';
}
¿Alguien puede decirme que ésta mal?¿Hay otra manera de hacerlo?
Saludos y gracias