Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Sep 2004
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DropDown menu problem in IE

    Hi, I'm fairly new to coding and such. I tried following the guide to making this on http://www.alistapart.com/articles/horizdropdowns/
    I am currently having problems trying to get me submenus to show up in IE. the following code works on netscape just fine. Can anyone help me out on this issue? please be gentle since i am a noob

    heres the code:

    <html>
    <head>
    <title>Submenu Creation</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    ul {
    id: nav;
    font-family: "Arial", "Helvetica", sans-serif;
    margin: 0;
    padding: 0;
    list-style: none;
    width: 150px;
    border-bottom: 1px solid #ccc;
    }


    ul li {
    position: relative;
    }

    li ul {
    position: absolute;
    left: 149px;
    top: 0;
    display: none;
    }

    ul li a {
    display: block;
    text-decoration: none;
    color: #777;
    background: #fff;
    padding: 5px;
    border: 1px solid #ccc;
    border-bottom: 0;
    }
    li:hover ul, li.over ul {
    display: block; }

    /* Fix IE. Hide from IE Mac \*/
    * html ul li { float: left; height: 1%; }
    * html ul li a { height: 1%; }
    /* End */

    startList = function() {
    if (document.all&&document.getElementById) {
    navRoot = document.getElementById("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;
    }

    </style>

    </head>

    <body bgcolor="#FFFFFF" text="#000000">
    <ul>
    <li><a href="#">Network</a>
    <ul>
    <li><a href="#">Audit</a></li>
    <li><a href="#">Integrate</a></li>
    <li><a href="#">Expand</a></li>
    <li><a href="#">Relocate</a></li>
    </ul>
    </li>
    <li><a href="#">Security</a>
    <ul>
    <li><a href="#">Audit</a></li>
    <li><a href="#">Assess</a></li>
    <li><a href="#">Identify</a></li>
    <li><a href="#">Encrypt</a></li>
    </ul>
    </li>
    <li><a href="#">Planning</a>
    <ul>
    <li><a href="#">Security Schema</a></li>
    <li><a href="#">Network Design</a></li>
    <li><a href="#">Wireless design</a></li>
    <li><a href="#">Business Continuity & Disaster Recovery</a></li>
    <li><a href="#">Policy and Governance</a></li>
    </ul>
    </li>
    <li><a href="#">Support</a>
    <ul>
    <li><a href="#">Infrastructure</a></li>
    <li><a href="#">Help Desk</a></li>
    <li><a href="#">Product</a></li>
    </ul>
    </li>
    </ul>

    </body>
    </html>

  • #2
    New Coder
    Join Date
    Oct 2004
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    startList = function() {
    if (document.all&&document.getElementById) {
    navRoot = document.getElementById("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;
    }
    Isn't this JavaScript? Shouldn't it be in the JavaScript forum? And shouldn't it be inside <script> tags? And as another point, providing an address to a site with it running is better than posting huge amounts of code, especially when you haven't enclosed it in code tags.
    Please visit My Site - Especially if you play CS or DoW.

    'Don't worry men, they couldn't hit a bull at this distance.' - Last words of General Patton

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Stillwater Ok
    Posts
    226
    Thanks
    0
    Thanked 0 Times in 0 Posts
    miggs007 is right, this:
    Code:
    startList = function() {
      if (document.all&&document.getElementById) {
        navRoot = document.getElementById("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;
    Should be in a <script> tag.
    "Never offend people with style when you can offend them with substance."
    --Sam Brown


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •