Results 1 to 3 of 3
Related
-
Dynamic drop downs using cookies to store Forum: Javascript Forum
Replies: 0 -
Jump Menu covers drop down menu Forum: HTML Forum
Replies: 1 -
Drop down menu Forum: HTML Forum
Replies: 6 -
Pop Ups and Drop Downs! Forum: Website Scripts Forum
Replies: 1
-
05-26-2005, 07:21 AM #1
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";
}
-
05-26-2005, 02:36 PM #2
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')"
(this is in the <div>)
Code:onmouseover "Menu('xxx')"
but i am not that great at JavaScript
-
05-28-2005, 08:45 AM #3
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
Cloudjiffy- PaaS for Developers
10-05-2020, 12:30 AM in Web Hosting Forum