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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Apr 2006
    Posts
    111
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Code wont work in IE for drop down menu :(

    Here is the css:

    Code:
    ul {
      padding: 0;
      margin:auto;
      list-style: none;
      }
    li {
      Margin:auto;
      position: relative;
      width: 10em;
      }
    li ul {
      background:#8e8e8e;
      display: none;
      position: absolute; 
      top: 1em;
      left: 0;
      }
    li > ul {
    	top: auto;
    	left: auto;
    	}
    li:hover ul {
     display: block;
    }
    Here is the html:

    Code:
    <ul id="nav">
      <li>Grunts
        <ul>
          <li id="menu"><a href="">Small</a></li>
          <li id="menu"><a href="">Burrito</a></li>
          <li id="menu"><a href="">Pigfish</a></li>
        </ul>
      </li>
    </ul>
    JAVASCRIPT:

    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;
    I really have no clue as to why this isn't working, if you could please give me a straight answer I would be pleased.

    The site is on freewebs currently becuase I find it easy to make the design there ^_^

    http://www.freewebs.com/clan-aad/

  • #2
    Regular Coder
    Join Date
    Apr 2006
    Posts
    111
    Thanks
    0
    Thanked 2 Times in 2 Posts
    I seem to have fixed my problem by trying a different method ty anyway though.


  •  

    Posting Permissions

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