View Single Post
  #1 (permalink)  
Old May 11th, 2005, 11:06 AM
John K. King John K. King is offline
Authorized User
Join Date: Jun 2003
Location: Sheridan, OR, USA.
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default Delay mouse events until page loaded?


I'm building a vertical navigation bar and my goal is to make it work in a similar fashion to what you can see, for example, at the Seattle Times (

I'm using the onmouseover() and onmouseout() events to change the text and background colors as the mouse goes over a menu item.

(question: can 'hover' be used to accomplish the same effect? I've tried it but haven't been successful with anything other than the text-decoration attributes)

What I have works fine except for one thing: while working with it, I had a Javascript console open and I saw what initially appeared to be spurious errors and warnings complaining about the functions and objects related to the onmouseover() and onmouseout() events.

The messages have to do with the function not being defined, or an object in the function not being an object.

After playing with it for a while, I've convinced myself that the messages are not spurious. I believe that what happens is this: If I click a menu item and the page reloads contracting an existing submenu and exposing the new submenu, moving the mouse over one or more of the menu selections, firing the events, before the page finishes loading is what causes the messages. If I am reasonably deliberate about not moving the mouse immediately after clicking on a menu item, no messages.

Is there someway to suppress mouse events while the page is loading, or is there another way to accomplish the same goal without using onmouseover() and onmouseout()?

I'm not using DHTML and the display style attribute to hide and show submenus because a new page to loads with each menu selection, so there is no need to use DHTML. In this application, the page displayed does not remain the same as one peruses the menu.



Reply With Quote