SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Guru
    Join Date
    Jan 2007
    Posts
    971
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Need dropdown menu HELP!

    OK, I don't know very much javascript. Last time I did a dropdown menu, I used a wildly complicated css script. It looks like javascript/css is a simpler way.

    Here's what I have so far. They drop down OK, but they don't stay dropped down when your over the list.

    http://s181455844.onlinehome.us/nextpoint2/base.html


    Here's the code I used:

    (Based on:
    http://www.w3schools.com/dhtml/tryit...rydhtml_menu10)

    <script type="text/javascript">
    function showmenu(elmnt)
    {
    document.getElementById(elmnt).style.display="block";
    }
    function hidemenu(elmnt)
    {
    document.getElementById(elmnt).style.display="none";
    }
    </script>


    #wrapper .dropdown {
    list-style-type: none;
    background-color: #FFFFFF;
    width: 150px;
    border: 1px solid #CC0000;
    position: absolute;
    top: 175px;
    left: 33px;
    display: none;

    }
    #wrapper #positioning_div #dmenu6 {
    left: 715px;
    }
    #wrapper #positioning_div #dmenu5 {
    left: 610px;
    }
    #wrapper #positioning_div #dmenu4 {
    left: 477px;
    }
    #wrapper #positioning_div #dmenu3 {
    left: 343px;
    }
    #wrapper #positioning_div #dmenu2 {
    left: 206px;
    }
    #wrapper .dropdown a {
    color: #000000;
    text-decoration: none;
    display: block;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: #cc0000;
    padding: 5px;
    }
    #wrapper .dropdown a:hover {
    background-color: #DADADA;
    }
    #wrapper .dropdown .lastlink {
    border-top-style: none;
    border-right-style: none;
    border-bottom-style: none;
    border-left-style: none;
    }

    Is there a way I can fix this without redoing lots of stuff?


    Thanks,
    Michael

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    You may find that Stu Nicholls has a drop-down menu that works for you. They are pure css and the code and the effect is excellent.


Bookmarks

Posting Permissions

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