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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delay an event handler

Status
Not open for further replies.

pathenry

IS-IT--Management
Mar 4, 2002
1
GB
My problem results from the way the newest version of IE hadles mouseOver and mouseOut events. I use these functions to place text in a frame from the same link, that is, I change text on both the mouseOver and mouseOut events. The porblem is, when moving rapidly across links, IE ignores mouseOvers that follow quickly after mouseOuts.

I can solve the problem by delaying the initiation of the mouseOver by about 10 milleseconds, using a setTimeout delayed function. Since I have a few thousand links, it is not conveniet to write that many functions to handle this simple chore.

Is there some way to generally control event handlers, like mouseOver, such as delaying them for all events on a given page?

Thanks for the help!

Pat
 
There is no way to generally control all event
handlers. but I guess the following would do the job too:


good luck,

Tristan Laurillard
harlekeyn@gmx.net




index.html:
=====================================
Code:
<html>
<head><title></title>
</head>
<frameset cols=&quot;50%,50%&quot; border=0>
	<frame name=&quot;firstframe&quot; src=&quot;test.html&quot; NORESIZE>
	<frame name=&quot;otherframe&quot; src=&quot;blank.html&quot; NORESIZE>
</frameset>
</html>
====================================



test.html
====================================
Code:
<html>
<head>
<SCRIPT LANGUAGE=&quot;JavaScript&quot;>

function flap(xx)
{
setTimeout(&quot;changethatvalue('&quot; + xx + &quot;')&quot;,10) ;
}

function flop(yy)
{
changethatvalue(yy) ;
}

function changethatvalue(what)
{
parent.otherframe.myform.myinput.value = what ;
}

</SCRIPT>
</head>

<body>

<a href=&quot;blabla1.html&quot; onmouseover=flap(&quot;mary&quot;) onmouseout=flop(&quot;had&quot;)>your link 1</a><br><br>
<a href=&quot;blabla2.html&quot; onmouseover=flap(&quot;a&quot;)    onmouseout=flop(&quot;little&quot;)>your link 2</a><br><br>
<a href=&quot;blabla3.html&quot; onmouseover=flap(&quot;lamb&quot;) onmouseout=flop(&quot;something&quot;)>your link 3</a><br><br>

</body>
</html>
=========================================


and blank.html:
=========================================
Code:
<html>
<head><title></title>
</head>
<body>
<form name=&quot;myform&quot;>
<input name=&quot;myinput&quot;>
</form>
</body>
</html>
==========================================
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top