33 lines
838 B
JavaScript
33 lines
838 B
JavaScript
|
const boutons = [
|
||
|
document.getElementById("accueil"),
|
||
|
document.getElementById("entreprise"),
|
||
|
document.getElementById("produits"),
|
||
|
document.getElementById("contact")
|
||
|
]
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
function change_fond(element) {
|
||
|
console.log(element);
|
||
|
element.style.textShadow = "2px 2px 5px black";
|
||
|
element.style.transition = "transform 0.2s ease"
|
||
|
element.style.transform = "scale(1.1)";
|
||
|
console.log("Ombre changée !");
|
||
|
}
|
||
|
|
||
|
function reset_fond(element) {
|
||
|
element.style.textShadow = "";
|
||
|
element.style.transform = ""
|
||
|
console.log("Ombre retirée !");
|
||
|
}
|
||
|
|
||
|
for(let i = 0; i != 4; i++) {
|
||
|
boutons[i].addEventListener("mouseover", function() {
|
||
|
change_fond(boutons[i]);
|
||
|
});
|
||
|
|
||
|
boutons[i].addEventListener("mouseout", function() {
|
||
|
reset_fond(boutons[i]);
|
||
|
});
|
||
|
}
|