Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 11th, 2005, 11:06 AM
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 (http://www.seattletimes.com).

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
  #2 (permalink)  
Old May 11th, 2005, 11:19 AM
Authorized User
Join Date: Jun 2003
Location: Sheridan, OR, USA.
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts


Thinking about it some more, it could be that the messages are generated as the mouse events are generated while the old page unloads rather than as the new page loads. I'll have to look into determining which it is.

Still, if anyone can help, I'd appreciate it.


Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
check if page is loaded darkhalf Javascript 1 October 4th, 2005 05:26 AM
how to check if page is already loaded? phpworker Javascript How-To 0 July 31st, 2005 11:49 AM
mouse events calvados Pro VB.NET 2002/2003 6 January 15th, 2005 08:03 AM
How to trap Mouse events on Title bar/Caption bar chiefouko Pro VB.NET 2002/2003 0 September 21st, 2004 02:42 AM
Page Loaded in Seconds Scripts hcweb Classic ASP Basics 8 February 25th, 2004 09:58 PM

All times are GMT -4. The time now is 04:56 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.