34 users online (0 members and 34 guests)  


  Results 1 to 3 of 3

Related

  1. Dynamic drop downs using cookies to store    Forum: Javascript Forum
    Replies: 0
  2. Jump Menu covers drop down menu    Forum: HTML Forum
    Replies: 1
  3. Drop down menu    Forum: HTML Forum
    Replies: 6
  4. Pop Ups and Drop Downs!    Forum: Website Scripts Forum
    Replies: 1
  1. #1
    trdn1's Avatar
    New User

    Status
    Offline
    Join Date
    May 2005
    Posts
    2

    vertical drop down menu with 'sub drop downs' problem

    the page with my menu i'm working on is here:
    http://www.fishingcamp.org/newmenu/vertmenu3.html

    I am looking to make a vertical drop down menu with sub drop-downs for most selections.

    if you mouseover the FC01-05, the drop down for that appears fine, then over FC01 and it disappears but the sub drop down now appears (FC01 img again for trial purposes).

    the goal here is that as you mouse over FC01, the sub menu appears while leaving the host menu up, like you've probably seen around the web.

    I've done some legwork on this, but can't seem to get anywhere with the ideas I've seen. Any help is greatly appreciated, and I'll definately embed your help in the code.

    The script for this is:

    var inmenu=false;
    var lastmenu=0;
    function Menu(current) {
    if (!document.getElementById) return;
    inmenu=true;
    oldmenu=lastmenu;
    lastmenu=current;
    if (oldmenu) Erase(oldmenu);
    m=document.getElementById("menu-" + current);
    box=document.getElementById(current);
    box.style.left= m.offsetLeft + m.offsetWidth + 2;
    box.style.top= m.offsetTop;
    box.style.visibility="visible";
    m.style.backgroundColor="#2D6C0E";
    box.style.backgroundColor="#2D6C0E";
    box.style.width="100px";
    }
    function Erase(current) {
    if (!document.getElementById) return;
    if (inmenu && lastmenu==current) return;
    m=document.getElementById("menu-" + current);
    box=document.getElementById(current);
    box.style.visibility="hidden";
    m.style.backgroundColor="#2D6C0E";
    }
    function Timeout(current) {
    inmenu=false;
    window.setTimeout("Erase('" + current + "');",50);
    }
    function Highlight(menu,item) {
    if (!document.getElementById) return;
    inmenu=true;
    lastmenu=menu;
    obj=document.getElementById(item);
    obj.style.backgroundColor="#2D6C0E";
    }
    function UnHighlight(menu,item) {
    if (!document.getElementById) return;
    Timeout(menu);
    obj=document.getElementById(item);
    obj.style.backgroundColor="#2D6C0E";
    }

  2. #2
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: vertical drop down menu with 'sub drop downs' problem

    that's because you have:
    (this is in the href)
    Code:
    onmouseover="swapon2(),Menu('sales')"
    and:
    (this is in the <div>)
    Code:
    onmouseover "Menu('xxx')"
    what is happening is: you are hovering over the item to show the menu, but when they hover over the links in the <div> it automatically replaces the existing menu. try making each div their own.

    but i am not that great at JavaScript

  3. #3
    trdn1's Avatar
    New User

    Status
    Offline
    Join Date
    May 2005
    Posts
    2

    Re: vertical drop down menu with 'sub drop downs' problem

    thanks for the advice, i took a shot at the actual code and just ended the day frustrated...after walking the dog and some dinner, I decided to just include the 'sub-sub-menu' items with the sub menu. sometimes the simpler ideas are the hardest to come up with, but in the end I think it even works better.

    the script as it was written, called for the sub menu on mouseover and displayed it. once mouseout, then it (the old menu) would close or time out. my attempt was to do that twice basically while keeping the root menu open...tough to explain, even tougher to code.


    you can see how it ended up at
    www.fishingcamp.org



Tags for this Thread