Bonjour, Je cherche à faire des essais et là je bloque:
Je souhaiterai faire un rollover sur un lien et modifier le background de la balise body:
Ça ne fonctionne pas :Ça fonctionne :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 body { background-color: yellow; } <body> <a href="#" onmouseover="document.getElementsByTagName('body').style.backgroundColor='Blue';" onmouseout="document.getElementsByTagName('body').style.backgroundColor='yellow';">lien</a></body>Ça ne fonctionne pas :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 #er { background-color: yellow; } <body id="er"> <a href="#" onmouseover="document.getElementById('er').style.backgroundColor='Blue';" onmouseout="document.getElementById('er').style.backgroundColor='yellow';">lien</a></body>Merci pour vos réponses
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 body { background-image: url(img1.jpg); } <body> <a href="#" onmouseover="document.getElementsByTagName('body').style.backgroundImage=url('img2.jpg');" onmouseout="document.getElementsByTagName('body').style.backgroundImage=url('img1.jpg');">lien</a></body>
Partager