Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

event.clientX Error!!! Pls Help

Status
Not open for further replies.

Bernini

Programmer
Oct 26, 2004
98
0
0
MT
Hi all

I have the following very simple function:

Code:
function OutMenuItem()
{
  var mX = event.clientX;
  alert (mX);
}

This function is called on the onmouseout event of a div by using:

Code:
onmouseout="setTimeout('OutMenuItem();', 500);"

When i run the script an error Object Required is shown before the alert function!

Does anyone have a any clue!?

Thanks
B
 
Because the event doesn't exist anymore after the half-second you wait. Try this:

Code:
function OutMenuItem(mX)
{
  alert (mX);
}

Code:
onmouseout="setTimeout('OutMenuItem('+event.clientX+');', 500);"

Adam

recursion (n.) See recursion.
 
Oooh!! understandable!!

thanks! I'll try it out!

B
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top