Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Archived Topics for the old Version 3.0 JavaScript Menu
Forum Topic: Click to view post
Last Updated: Wednesday July 18 2012 - 06:07:30

Problem when no mouse off background color


Poster: jimbrooking
Dated: Wednesday July 24 2002 - 23:21:13 BST

I'm laying the menu on top of a table with a background image. I do not want a background color in the main menu unless the mouse is over the menu item, or over a sub-menu. I do want a background color when the mouse is over the menu item. I have done this to my satisfaction with the "style1" definition built into the menu_array. I just set the mouse off background color definition to "" (an empty string).

For my sub-menus, I do want a background color when the mouse is not over the item (and of course a different color when the mouse is over the item. This was easily done by making a copy of the "style1" definition, renaming the copy to "style2" and changing only the mouse off background color. Now "style1" is applied to the main menu and "style2" to all the others.

This works wonderfully well, as you can see at http://www.intrex.net/jimbrooking/default2.htm (my personal web site, he said modestly). But there is a small hitch: The mouse-off background color, which is no color, or transparent, is not restored after the mouse moves off the selection.

Any ideas of how I might fix this? I am a rank novice at javascript, so hesitate to dig in, for fear of irreparably breaking this wonderful system.

Thanks,
Jim


Poster: jimbrooking
Dated: Saturday July 27 2002 - 16:15:39 BST

Well, finally tracked this down. It wasn't a problem with Andy's fine code at all (silly me!), but instead it was interference from another JS snippet I had imported to put the last-modified date on the page. For some reason I don't understand (I _did_ say I was a rank amateur, didn't I?) the last-updated code had a function named Array that apparently populates a JS Array with the calling arguments.

When I renamed this function definition, (Letting the JS Array declaration take its course) the menu worked fine. Sorry to bother y'all with this "shot myself in the foot" inguiry. :oops:

Jim