Working with Absolute menu

M

Mike

Hey guys,

I'm working on a website, and the owner really wants a pop-down menu;
you know, where you mouse over the button and the sub menu pops up.
I'm having two minor issues, and I'm hoping for some tips.

First things first, the script has a primary section that defines the
main menu (a table with 6 cells, all with images), then a subroutine
called "function menu(x)" that is called when someone mouses over the
main menu; x will equal a number, which defines which array is loaded
for the subroutine. Sort of like:

function menu(x) {
var showMenu;

if (x == 0) { // this means to clear the screen
showMenu = " ";
}

else if (x == 1) {
names = new Array (
"<img src=buttons/1a.gif width=138 height=24 border=0",
"<img src=buttons/1b.gif width=138 height=24 border=0
)
}
...
}

Then, there's a final subroutine called "function clearIt()" that
clears the menus by using setTimeout to send a "0" to menu(x).


1. I'm building this around a pre-existing site, which means that the
sub menu will need to show up on "top" of existing pictures, text,
etc. If I'm not mistaken, this means I have to use absolute
positioning. This would be OK, except that the menu should be centered
on the page, and I can't figure a way to center the submenu with
absolute position. I know this is really a CSS question, and I
apologize for asking it here, but I figured that anyone with
experience in these menus would know for sure.

2. How do I reset the setTimeout function in "clearIt()"? When the
viewer mouses over a button, the sub menu pops up, and I would like
for the submenu to stay up if the mouse is on the original button or
submenu, indefinitely (but close after 5 seconds once they take their
mouse away). I tried giving another "onMouseOut='clearIt()'" command
to the submenu, but it doesn't reset the timer.

TIA for any help you can give!

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top