General discussion

Locked

a delay or pause function in javascript

By gsuruy ·
I need a function like pause or delay to use in javascript in order to wait some seconds before calling another function withe the setTimeout function of javascript. Any help will be very welcome.

Best regards.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

a delay or pause function in javascript

by tjc In reply to a delay or pause function ...

the below is a snipit of code that will pause the script for 5 seconds. Call it like any other function in javascipt.

// pause delay for 5 seconds
function pause() {
var now1= now2= diffrence = ' ';
now1 = new Date();
now2 = new Date();
while (diffrence < 5000) {
now2 = new Date();
diffrence = Date.parse(now2) - Date.parse(now1);
} //end while 5 second delay
}

Collapse -

a delay or pause function in javascript

by gsuruy In reply to a delay or pause function ...

Thanks a lot for your valuable response, because of the everyday hurries i forto to say thanks.

Have a nice day.

gsuruy.

Collapse -

a delay or pause function in javascript

by gsuruy In reply to a delay or pause function ...

This question was closed by the author

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums