Au fait je n'arrive pas à le faire marcher sous Firefox. sachant que je suis débutant en JavaScript j'avoue que je galere !
Voici donc le code JS:
function expandCollapse(objElement) {
var imgIcon = objElement.children[0];
objElement = objElement.children[1];
if (objElement.style.display == "none" ) {
objElement.style.display = "block" ;
imgIcon.src = "images/fond/fleche_b.jpg" ;
}
else {
objElement.style.display = "none" ;
imgIcon.src = "images/fond/fleche_g.jpg" ;
}
}
Voici le code HTML :
<DIV onclick="expandCollapse(this); ">
<IMG name='I1' SRC="images/fond/fleche_g.jpg" height = '30' width = '30' /> Le langage Javascript
<DIV STYLE="display: none" >
<A onclick="stopPropagation() ;">Page d'accueil</A><BR>
<A onclick="stopPropagation() ;">Etude du langage</A><BR>
<A onclick="stopPropagation());">Les objets clients</A><BR>
</DIV>
</DIV>
Merci
Message édité par unes92 le 10-06-2009 à 11:25:52