Ho trovato online uno script per un menu a discesa del tipo (chiedo venia ma
userò un linguaggio elementare vista la mia totale ignoranza in materia)
- TITOLO
ci si clicca sopra ed appaiono le voci relative
- TITOLO
argomento1
argomento2
ecc.
Il codice è il seguente
if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.menu_int{display: none;}\n')
document.write('</style>\n')
}
function SwitchMenu(obj){
if(document.getElementById){
var el = document.getElementById(obj);
var ar =
document.getElementById("principale").getElementsB yTagName("span");
if(el.style.display != "block"){
for (var i=0; i<ar.length; i++){
if (ar[i].className=="menu_int")
ar[i].style.display = "none";
}
el.style.display = "block";
}else{
el.style.display = "none";
}
}
}
......mentre nella pagina html il richiamo è
<div id="principale">
<div class="titolomenu" onclick="SwitchMenu('sub1')">TITOLO1</div>
<span class="menu_int" id="sub1">
- <a href="#">argomento1</a><br>
- <a href="#">argomento2</a><br>
- <a href="#">argomento3</a>
</span>
<div class="titolomenu" onclick="SwitchMenu('sub2')">TITOLO2</div>
<span class="menu_int" id="sub2">
- <a href="#">argomento4</a><br>
- <a href="#">argomento5</a><br>
- <a href="#">Script ASP</a>
</span>
Vorrei modificare un menu in questione in modo che, al clic sul secondo
titolo, il primo rimanga aperto (e mostri tutti i suoi argomenti) e non si
chiuda.
Cosa va modificato?
Grazie mille in anticipo per ogni informazione!
--
Andrea
- - - - - - - - - - - - - - -
www.italiatibet.org www.thehungersite.com