Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > javascript not working in IE 6 for drop down menu, why?

Reply
Thread Tools

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

 
 
toby@itzagalerias.com
Guest
Posts: n/a
 
      07-07-2006
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[i];
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">

 
Reply With Quote
 
 
 
 
cwdjrxyz
Guest
Posts: n/a
 
      07-07-2006

http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> 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."


<snip>

> <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[i];
> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Affecting a dynamically created drop down from another dynamically created drop down. msimmons ASP .Net 0 07-16-2009 03:17 PM
retrive preselected value in second drop down list from the first drop down list weiwei ASP .Net 0 01-05-2007 07:29 PM
Multiple select drop down poplulating sub drop down scott@dettcom.com Javascript 3 11-09-2006 07:50 PM
Auto Drop down a Drop Down List xxbmichae1@supergambler.com Javascript 5 11-23-2005 01:35 AM
New to .NET, can I have one drop down box control the data of another drop down box using a database? SirPoonga ASP .Net 2 01-07-2005 10:44 PM



Advertisments