473,387 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 1789
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.