Javascript
Résolu/Fermé
arthezius
Messages postés
3538
Date d'inscription
jeudi 15 mai 2008
Statut
Membre
Dernière intervention
11 septembre 2016
-
6 déc. 2009 à 04:08
arthezius Messages postés 3538 Date d'inscription jeudi 15 mai 2008 Statut Membre Dernière intervention 11 septembre 2016 - 6 déc. 2009 à 15:03
arthezius Messages postés 3538 Date d'inscription jeudi 15 mai 2008 Statut Membre Dernière intervention 11 septembre 2016 - 6 déc. 2009 à 15:03
A voir également:
- Javascript
- Telecharger javascript - Télécharger - Langages
- Table de multiplication javascript ✓ - Forum Javascript
- Javascript echo ✓ - Forum PHP
- Quelque chose bloque le fonctionnement de javascript sur votre ordinateur ✓ - Forum Virus
- Retour à la ligne javascript ✓ - Forum Javascript
1 réponse
PhP
Messages postés
1767
Date d'inscription
lundi 11 décembre 2000
Statut
Membre
Dernière intervention
23 décembre 2009
606
6 déc. 2009 à 09:09
6 déc. 2009 à 09:09
Bjr
En ajoutant une liste d'icônes que tu synchronises lors de l'appel à switchMenu
Ex
En ajoutant une liste d'icônes que tu synchronises lors de l'appel à switchMenu
Ex
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xml:lang="fr" lang="fr" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Test menu</title> <style> * { font-family : arial; font-size : 12pt; } </style> <script> function switchMenu(obj) { var elIcon = document.getElementById(obj+"_icon"); var el = document.getElementById(obj); if(el.style.display != "block") { el.style.display = "block"; elIcon.src = icons["up"].src; } else { el.style.display = "none"; elIcon.src = icons["down"].src; } } var icons = new Object(); function load() { icon = new Image(); icon.src = "fleche_haut.jpg"; icons["up"] = icon; icon = new Image(); icon.src = "fleche_bas.jpg"; icons["down"] = icon; } </script> </head> <body onload="load()"> <h3><a onclick="switchMenu('m_tr');" href="#" ><img id="m_tr_icon" src="fleche_bas.jpg" />Travaux</a></h3> <div id="m_tr" style="display:none;"> <p><a href="lien1.html">Lien 1</a></p> <p><a href="lien2.html">Lien 2</a></p> <p><a href="lien3.html">Lien 3</a></p> </div> </body> </html>
6 déc. 2009 à 15:03
Le résultat ici: http://arthezius.fr/accueil.html