473,473 Members | 1,513 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Vertical reveal menu

Hi all, I've been working on a vertical reveal menu. Right now it
works ok with CSS. But what i'd like it to do is when you mouse over,
reveal the menu and have that menu stay open until the user mouses
over another menu item. Right now it's a bit jumpier than i'd like it
and would like to basically have it stay open on a mouse out event,
again until it hits another menu item. Is this possible? Any direction
would be great.

sample menu: http://www.mikepetruna.com/menu.html

thanks!
Mike

Aug 4 '07 #1
1 1791
Here's how I would modify your code to do what you want. I haven't
checked it for syntax. Hopefully you have enough javascript knowledge
to know how to fix any syntax errors below.
<style>
dd { display: none };
</style>

<script>
var activeMenuParent = null;
function setDisplay ( parent, display ) {
if ( ! parent ) return; // parent not set, do nothing

var els = parent.getElementsByTagName ( 'dd' );
for ( var i = 0 ; i < els.length; i ++ )
els[i].style.display = display;
}

function hideMenu ( parent ) {
setDisplay ( parent, 'none' );
}
function showMenu ( link ) {
hideMenu ( activeMenuParent ); // hide menu if showing
var parent = link.parentNode.parentNode; // a, dt, dl
setDisplay ( parent, 'block' );
this.activeMenuParent = parent;
}
</script>

<html>
<div id="dlmenu">

<ul id="menu">
<li>
<!--[if lte IE 6]><a href="#nogo"><table><tr><td><![endif]-->
<dl class="gallery">
<dt><a href="#" class="menu" onmouseover="showMenu(this)">Menu</a></
dt>
<dd><a href="#">SubMenu 1</a></dd>
<dd><a href="#">SubMenu 2</a></dd>
<dd><a href="#">SubMenu 3</a></dd>

</dl>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
<li>
<!--[if lte IE 6]><a href="#nogo"><table><tr><td><![endif]-->
<dl class="gallery">
<dt><a href="#" class="menu" onmouseover="showMenu(this)">Menu 2</a></
dt>
<dd><a href="#">SubMenu 1</a></dd>
<dd><a href="#">SubMenu 2</a></dd>
<dd><a href="#">SubMenu 3</a></dd>

</dl>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
</ul>
</div>
</html>

Aug 4 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Don Schneider | last post by:
I tried to setup a frameset which consists of 4 different subframes. Each of these subframes should fetch a different web page from the internet and display it completely (!). BUT: the vertical...
0
by: vikram.cvk | last post by:
Hello Experts, Im trying to design a CSS vertical drop down menu which should have the following functionality. Home About Us | -->Overview
4
by: Nicholas | last post by:
Hi I've set up a vertical css based menu using the hover property the problem is that the hover colour only covers the text. so if menu item 1 is 'this is menu item 1' that gets covered ...
8
by: charlie | last post by:
does anyone know of a css vertical menu like the one at projectseven? http://projectseven.com/viewer/index.asp?demo=pmm Or http://projectseven.com/viewer/index.asp?demo=tmm I did google...
0
by: ashkaan57 | last post by:
Hi, I am trying to put a vertical line between two DIVs that are contianers for menu and content. I added another DIV in between them and set the background-image and repeat-y but it doesn't...
4
by: umlv | last post by:
Hi, I have a question about vertical text property for labels. I have set several labels to show vertical text on one of my forms. I had no problems with them on my desktop computer. Now I...
9
by: paintedjazz | last post by:
Okay, based on what I had seen others do, I modified their stylesheet and created a test webpage of a pure CSS dropdown menu. When I got it perfected exactly the way I wanted it, I moved it into...
0
by: joeriatscripts | last post by:
The example: Example. And the code again down this post. There is a vertical gap (assumable 3px) between the MENU & CONTENT and MENU & HEADER. The layout shows perfectly in IE7 / FF2 etc. Just IE6...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.