Salut
J'ai ce script sous la main et voilà mon probleme: quand on affiche un calque avec le 1er menu déroulant, il disparait quand affiche un autre calque avec le 2ème menu déroulant. Donc je voudrais savoir comment faire pour que le calque du premier menu déroulant reste affiché à l'ecran quand on affiche le second calque avec l'autre menu déroulant (en gros je veux voir à l'ecran les 2 calques en même temps). Merci d'avance.
<HTML><HEAD><SCRIPT LANGUAGE="JavaScript"> var encours="";function AffLayer1(liste) { var nomlayer=liste.options[liste.selectedIndex].value; if (document.all) { if (encours!="" ) {document.all[encours].style.visibility="hidden";} encours=nomlayer; if (nomlayer!="" ) {document.all[encours].style.visibility="visible";} } if (document.layers) { if (encours!="" ) {document.layers[encours].visibility="hide";} encours=nomlayer; if (nomlayer!="" ) {document.layers[encours].visibility="show";} } if (document.getElementById) { if (encours!="" ) {document.getElementById(encours).style.visibility="hidden";} encours=nomlayer; if (nomlayer!="" ) {document.getElementById(encours).style.visibility="visible";} }} </SCRIPT> <SCRIPT LANGUAGE="JavaScript"> var encours="";function AffLayer2(liste) { var nomlayer=liste.options[liste.selectedIndex].value; if (document.all) { if (encours!="" ) {document.all[encours].style.visibility="hidden";} encours=nomlayer; if (nomlayer!="" ) {document.all[encours].style.visibility="visible";} } if (document.layers) { if (encours!="" ) {document.layers[encours].visibility="hide";} encours=nomlayer; if (nomlayer!="" ) {document.layers[encours].visibility="show";} } if (document.getElementById) { if (encours!="" ) {document.getElementById(encours).style.visibility="hidden";} encours=nomlayer; if (nomlayer!="" ) {document.getElementById(encours).style.visibility="visible";} }} </SCRIPT> </HEAD> <BODY> <FORM><SELECT NAME="liste" onChange='AffLayer1(this)'> <option value="">Choisir un calque</option> <option value="layer1">Voiture</option> <option value="layer2">Animaux</option> <option value="layer3">Maison</option></SELECT> </FORM> <DIV id="layer1" style="position:absolute;left:200px;top:100px;z-index:1;visibility:hidden"> Voiture</DIV> <DIV id="layer2" style="position:absolute;left:500px;top:300px;z-index:1;visibility:hidden"> Animaux</DIV> <DIV id="layer3" style="position:absolute;left:700px;top:400px;z-index:1;visibility:hidden"> Maison</DIV> <FORM><SELECT NAME="liste" onChange='AffLayer2(this)'> <option value="">Choisir un calque</option> <option value="layer4">nettoyage</option> <option value="layer5">travail</option> <option value="layer6">informatique</option></SELECT> </FORM> <DIV id="layer4" style="position:absolute;left:300px;top:600px;z-index:2;visibility:hidden"> Nettoyage</DIV> <DIV id="layer5" style="position:absolute;left:200px;top:500px;z-index:2;visibility:hidden"> Travail</DIV> <DIV id="layer6" style="position:absolute;left:450px;top:550px;z-index:2;visibility:hidden"> Informatique</DIV> </BODY></HTML>
Partager