javascript not working in IE 6 for drop down menu, why?

T

toby

Does anyone have an idea as to why the js does not work on the
horizontal drop down menu in IE 6? I have pretty much used exactly what
A List had posted in their article titled, "Drop-down Menus Horizontal
Style."

Any advice?
Thanks


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
body {min-width:825px}/* for mozilla and good browsers*/
</style>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>
<title>test.</title>
<script type="text/javascript">
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("frn_nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes;
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace
(" over", "");
}
}
}
}
}
window.onload=startList;
</script>


<link href="inc/2-COL-SLIDING_III.css" rel="stylesheet" type="text/css"
/>

<link href="inc/drop_down_menu.css" rel="stylesheet" type="text/css" />
</head>
<body>
<cfinclude template="inc/top_nav_left_nav.cfm">
<div id="frn_nav">
<ul id="frn_nav">
<li><a href="#">Home</a></li>
<li><a href="#">About</a>
<ul>
<li><a href="#">History</a></li>
<li><a href="#">Team</a></li>
<li><a href="#">Offices</a></li>
</ul>
</li>
<li><a href="#">Services</a>
<ul>
<li><a href="#">Web Design</a></li>
<li><a href="#">Internet
Marketing</a></li>
<li><a href="#">Hosting</a></li>
<li><a href="#">Domain Names</a></li>
<li><a href="#">Broadband</a></li>
</ul>
</li>
<li><a href="#">Contact Us</a>
<ul>
<li><a href="#">United Kingdom</a></li>
<li><a href="#">France</a></li>
<li><a href="#">USA</a></li>
<li><a href="#">Australia</a></li>
</ul>
</li>
</ul>
</div>
<cfinclude template="inc/bottom.cfm">
 
C

cwdjrxyz

Does anyone have an idea as to why the js does not work on the
horizontal drop down menu in IE 6? I have pretty much used exactly what
A List had posted in their article titled, "Drop-down Menus Horizontal
Style."

<style>
body {min-width:825px}/* for mozilla and good browsers*/
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>
<title>test.</title>
<script type="text/javascript">
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("frn_nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes;
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace
(" over", "");
}
}
}
}
}
window.onload=startList;
</script>


I would guess that Opera would handle the style correctly. In the
script that follows the style you are testing for both document.all and
document.getElementById support and then doing something if both are
supported. Not only IE, but also Opera supports both document.all and
document.getElementById. It will be interesting to see how Opera
responds, as it likely will attempt to support both the style and what
you do in the script just after the test.

It would be much more easy to see what is going on if you supplied a
test page. Perhaps someone else works with this sort of thing all of
the time and will at once see what is going on from your posted code
without having to try various modifications.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top