JavaScript básico :

Gente, porque quando eu uso "onmousemove", o primeiro comando pega, mas quando eu troco para onclick não funciona ?

<img onclick="quebraLampada()" onmouseout="apagaLampada()" onmousemove="acendeLampada()" id="img-lamp" class=" center" src="Images/Lampada.jpg" alt="Lâmpada" />

<script>

function acendeLampada() {
document.getElementById("img-lamp").src = "Images/LampadaA.jpg";
}

function apagaLampada() {
document.getElementById("img-lamp").src = "Images/Lampada.jpg";
}

function quebraLampada() {
document.getElementById("img-lamp").src = "Images/LampadaQ.jpg";
}

</script>​
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Lista de comentários


Helpful Social

Copyright © 2024 ELIBRARY.TIPS - All rights reserved.