RedRobotHero
Technical User
I'm using a folding menu from Dynamic Drive. It works fine in IE 6 and Netscape 7, but not in IE 5.2 on the Macintosh. Which is surprising, because the code tests for IE 4. You'd think it wouldn't be relying on anything only available in new browsers.
I don't get any error messages, and the rollovers are still working, but I can't expand the folding list.
Any idea what's doing this?
Here's the code, and a link to the site where I'm using this.
(I'm also planning on making it degrade a little more gracefully, so that if the Javascript won't run, it will be open, instead of closed. But that's another story, for another time.)
I don't get any error messages, and the rollovers are still working, but I can't expand the folding list.
Any idea what's doing this?
Here's the code, and a link to the site where I'm using this.
Code:
//Smart Folding Menu tree- By Dynamic Drive (rewritten 03/03/02)
//For full source code and more DHTML scripts, visit [URL unfurl="true"]http://www.dynamicdrive.com[/URL]
//This credit MUST stay intact for use
var head="display:''"
var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-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
(I'm also planning on making it degrade a little more gracefully, so that if the Javascript won't run, it will be open, instead of closed. But that's another story, for another time.)