[Javascript] delay in a function

Peter Brunone peter at brunone.com
Sun Mar 27 14:23:59 CST 2005


Hi!

	Welcome to the list.  It looks like you want to use the
setTimeout function.

setTimeout("functionName()", timeInMilliseconds)

	The simplest way to do this would be

function desplegar(id) {
var d = document.getElementById(id);
setTimeout("d.style.display='block'", 1000);
}

	This will delay the display by one second (one thousand
milliseconds).

Regards,

Peter

-----Original Message-----
From: javascript-bounces at LaTech.edu
[mailto:javascript-bounces at LaTech.edu] On Behalf Of Camilo Kawerín

Hi,

It´s my first post to the list, and I hope my english help me ;)

I have a simple function that show a dropdown menu made with nested 
list. It is launch by onmouseover event. Well, I would like to introduce

a little delay before the action. The function is:

function desplegar(id) {
var d = document.getElementById(id);
d.style.display='block';
}

I´ll aprecappreciate any help.

Regards,






More information about the Javascript mailing list