Tooltip in Javascript question; adding a delay

Madison Kelly linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org
Tue Apr 19 03:58:34 UTC 2005


Hi all,

   I have started using a wonderful canned tooltip app in my program 
that pops up a little tooltip on key words explaining their purpose in 
greater detail. I want to add a slight (~1 sec) delay between the time 
the user places their mouse over the trigger and the display of the box.

   I've tried to read up on how to do this but my JS skills aren't the 
best and I am having some trouble figuring out how to make this happen. 
As I understand I should be able to use 'setTimeout()' to cause the 
delay and 'clearTimeout()' to abort the display if the onmouseout event 
occurs. I just need some help actually doing it. :p

   The script is called with this:
<a onMouseOver="stm(a, bunch, of, variables)" onMouseOut="htm()">Blah</a>

   I need the passed variable to pass through. Here is a basic function:

function stm(var1, var2, ..., varN)
{
	/* I want the 1 sec delay here */
	<Show Tip based on the vars passed>
}

function htm()
{
	/* I want to abort 'stm' if it is still in the delay */
	<Hide Tip>
}

   Thanks for any info/help!

Madison

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Madison Kelly (Digimer)
TLE-BU, The Linux Experience; Back Up
http://tle-bu.thelinuxexperience.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list