Problem when no mouse off background color

Please note that official support for this menu version has now ceased. There are still plenty of users, though, and the forum is still running. Some of our long-time users may be able to help you out.
Post Reply
jimbrooking
Advanced
Advanced
Posts: 10
Joined: Wed Jul 17, 2002 8:36 pm

Problem when no mouse off background color

Post by jimbrooking »

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
jimbrooking
Advanced
Advanced
Posts: 10
Joined: Wed Jul 17, 2002 8:36 pm

Post by jimbrooking »

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
Post Reply