Tooltip in Javascript question; adding a delay

psema4 psema4-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Tue Apr 19 18:11:11 UTC 2005


My apologies, here's a complete example:

== snip ==

<html>
<head>
<title>Cancel mouseover on timeout test</title>

<script type="text/javascript">

var timerID;

function stm(name, text) {
       timerID = setTimeout('delayAlarm();', 1000);

       document.form01.frmName.value=name;
       document.form01.frmText.value=text;
       return;
}

function htm() {
       document.form01.frmName.value='';
       document.form01.frmText.value='';
       return;
}

function delayAlarm() {
       /* I want to abort 'stm' if it is still in the delay */

       timerID = clearTimeout(timerID);
       htm();
       return;
}

</script>
</head>

<body>

<form name="form01">
  <input type="text" name="frmName">
  <input type="text" name="frmText">
</form>

<p align=left>
  <a onMouseOver="stm('Some Name', 'Some text')"
onMouseOut="htm()">Mouseover Me!</a>
</p>

</body>
</html>

== snip ==

In the stm() and htm() functions, you'll want to replace the
references to the textboxes in form01 with the DIV names used by your
tooltipping script.

Not sure if I can clarify any better without knowing which "canned"
scripts your using.

-- 
- SGE
--
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