PDA

View Full Version : This works in Internet Explorer but not in netscape why????


cmckenna00
12-11-2002, 02:19 PM
Could anyone help me with this. I need this code to open in both netscape and internet explorer. Its works fine in explorer but not in netscape. Could someone possably tell me what to do. Or if any one has some code for a tree menu navagation could you possibly give me it.

Any help in this would great

<style>
<!--
#foldheader{cursor:pointer;cursor:hand ;
list-style-image:url(fold.gif)}
#foldinglist{list-style-image:url(list.gif)}
//-->
</style>

<script type="text/javascript">
<!--
var head="display:''"
img1=new Image()
img1.src="fold.gif"
img2=new Image()
img2.src="open.gif"

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=""
cur.style.listStyleImage="url(open.gif)"
}
else{
foldercontent.style.display="none"
cur.style.listStyleImage="url(fold.gif)"
}
}
}

if (ie4||ns6)
document.onclick=checkcontained

//-->
</script>


</script>

beetle
12-12-2002, 12:01 AM
Ack. Don't use that menu. I found that one a while back and decided it wasn't that great, so I made my own. I just started putting together a website on it here (http://www.peterbailey.net/nm/index.php). Like I said, I just put up the website today, so not everything is there. Anyhow, it's leaps and bounds better than what you've got there.

krycek
12-12-2002, 02:05 AM
LOL :D Blatent pimping :p

However, your menu is good, and I like the way in which you have approached the problem. :)

::] krycek [::

beetle
12-12-2002, 02:36 AM
Originally posted by krycek
LOL :D Blatent pimping :p

However, your menu is good, and I like the way in which you have approached the problem. :)

::] krycek [:: Guilty as charged ;)

The shortcomings in that menu were exactly the reasons why I decided to make my own.