Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript New to JS

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #27326
    kb2tfa
    Member

    Hi Im having trouble with this example of JS menu. can someone look over my code I can’t see what’s wrong.

    HTML file

    CSS FILE "style.css"

    Code:
    /* The whole menu */
    #menu {
    position: absolute;
    }

    /* each menu name */
    #menu li {
    float: left;
    list-style-type: none;
    padding-right: 20px;
    width: 100px;
    background-color: silver;
    }

    /* The entire submenu */
    #menu li ul {
    background-color: silver;
    margin: 0px;
    padding: 0px;
    }

    /* each submenu item */
    #menu li ul li {
    padding: 0px;
    margin: 0px;
    float: none;
    list-style-type: none;
    width: 80px;
    }

    JAVASCRIPT FILE "dropdown.js"

    Code:
    // global variables for timeout and for current menu
    var t=false, current;
    function SetupMenu(){
    if (!document.getElementsByTagName) return;
    items=document.getElementsByName(“li”);
    for (i=0; i
    #68633
    kb2tfa
    Member

    forgot to mention you’ll see comments like "lowercase" etc. that’s where I was trying some changes to fix, but nope

    #68643
    Robin
    Member

    Is is posible for you to start using jQuery? It’s way more easy and efficient way to create these kind of effects on your website.

    #68652
    kb2tfa
    Member

    the thought did cross my mind, but the documentation is so obtrude. I’ll look into it. thx

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.