ciao a tutti....
come mai questo menu ad albero non funziona con l'ultima versione di IE?
mi dice: style è nullo o non è un oggetto.
il codice js principale è questo:
var head="display:''"
var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Ope ra")==-1
function checkcontained(e){
var iscontained=0
cur=ns6? e.target : event.srcElement
i=0
if (cur.id=="foldheader")
iscontained=1
else
while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
if (cur.id=="foldheader"||cur.id=="foldinglist"){
iscontained=(cur.id=="foldheader")? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentElement
}
if (iscontained){
var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0]
if (foldercontent.style.display=="none"){
foldercontent.style.display=""
}
else{
foldercontent.style.display="none"
}
}
}
if (ie4||ns6)
document.onclick=checkcontained
------------------------------------------------------------------
il codice html è questo:
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="testo_bianco_big">
<tr>
<td><div align="left">
<ul>
<li id="foldheader">Tende a Bracci
<ul id="foldinglist" style="display:none","&{head}";>
<li id="foldheader">senza cassonetto
<ul id="foldinglist" style="display:none","&{head}";>
[*]California[*]Universa[*]Costarica[*]Mexico[*]Brasil[*]Univariant[*]Rio new[*]8000 EE Combi[*]8000 E Combi plus[*]Samba new[*]Jumbo[*]Jumbo BB[*]Elite[*]America
[/list]
<li id="foldheader">con cassonetto
<ul id="foldinglist" style="display:none","&{head}";>
[*]Caraibi[*]Shell[*]Europa[*]Cover[*]Malindi[*]Compacta[*]Oceania[*]Oceania plus[*]Orly[*]Olanda[*]Piuma[/list][/list]
<li id="foldheader">
Cappottine
<ul id="foldinglist" style="display:none","&{head}";>
[*]Standard35[*]Gradini35[*]Prolungata35[*]Standard50[*]Gradini50[*]Prolungata50[*]Cupola[*]Barletta[*]Vogue[*]Delta[*]Beta1002[*]Beta1003[/list]
<li id="foldheader">
Giardino
<ul id="foldinglist" style="display:none","&{head}";>
[*]Montecarlo
[*]Sanremo
[*]Giardino mini[*]Giardino[*]Giardino 94[*]Samos[*]Millenium[*]Sombrea[*]Nuvola[*]Rain cover[*]Silent Flap[*]Straip[/list]
<li id="foldheader">
Classiche
<ul id="foldinglist" style="display:none","&{head}";>
[*]6000 retrò[*]Loggia[*]Classique[*]Leuca[/list]
<li id="foldheader">
Tunnel e Pagode
<ul id="foldinglist" style="display:none","&{head}";>
[*]Tunnel singolo[*]Tunnel affiancati[*]Tunnel singolo in policarbonato[*]Tunnel affiancato in policarbonato[*]Pensiline[*]Antis[*]Melograno[*]Ginestra[*]Orchidea[*]Ready box[*]Hilton[*]Majestic[*]Luxor[/list]
<li id="foldheader">
Tende a caduta
<ul id="foldinglist" style="display:none","&{head}";>
[*]3000[*]3000 con guide[*]5000 s[*]t4[*]7000 e[*]7000 t[*]Winter balkon[*]3000 zip[*]3000 cavetto[*]Ostuni[*]Orizzonte[*]Roll[/list][/list]
</div>
<script type="text/javascript" src="js/cookies.js"></script></td>
</tr>
</table>
----------------------
il file cookies.js è questo:
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length> 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(off set, end))
}
}
return returnvalue;
}
var foldercontentarray=new Array()
var c=0
if (ns6){
for (i=0;i<document.getElementsByTagName("UL").length; i++){
if (document.getElementsByTagName("UL")[i].id=="foldinglist"){
foldercontentarray[c]=document.getElementsByTagName("UL")[i]
c++
}
}
}
if (get_cookie(window.location.pathname) != ''){
var openresults=get_cookie(window.location.pathname).s plit(" ")
for (i=0 ; i < openresults.length ; i++){
if (ns6){
foldercontentarray[openresults[i]].style.display=''
foldercontentarray[openresults[i]].previousSibling.previousSibling.style.listStyleIm age="none"
}
else{
foldinglist[openresults[i]].style.display=''
document.all[foldinglist[openresults[i]].sourceIndex -
1].style.listStyleImage="none" }
}
}
if (ns6||ie4){
var nodelength=ns6? c-1 : foldinglist.length-1
var nodes=new Array(nodelength)
var openones=''
}
function checkit(){
for (i=0 ; i <= nodelength ; i++){
if
((ns6&&foldercontentarray[i].style.display=='')||(ie4&&foldinglist[i].style.display==''))
openones=openones + " " + i
}
document.cookie=window.location.pathname+"="+openo nes
}
if (ns6||ie4)
window.onunload=checkit
-------------------------
vi prego sto impazzendooooo![]()