Padding Padding
Janet
Systems
 Register  Login 
Telephone  01628 566 178
Website Design, Hosting and Software Services
  Search 
Padding
corner Padding corner
Padding Padding
corner Padding corner
 Javascript Articles
Using timeouts in Javascript enables a preset delay to be set before a piece of code actions. for example we could have a layer revealed when the page loads, which after a predefined time disappears. Whilst a timeout is active the browser will continue to do other things. However, once the timeout comes to an end the browser will act on the code specified.

A timeout is started with the setTimeout() method.  This method takes two parameters, the first is a statement which may be a group of statements. This is enclosed in quotes.  The second parameter is the duration of the wait, as this is an integer (multiples or thousands of a second) it is not enclosed in quotes.

For example:

doIt = window.setTimeout(hideLayer('helpLayer',10000)

The variable doIt is used as an identifier for our timeout, this enables us to have more than one timeout active at a time.


This article viewed: 1480 times Back

Copyright © 2004-2007 Janet Systems Ltd.

 Print   

DotNetNuke Website design and hosting from £15.00 per month. More...

Looking for a website design company in the Thames Valley, call us on 01628 566178

DotNetNuke Modules
DotNetNuke Modules availalble from Janet Systems

DotNetNuke Skins
DotNetNukeSkins.gif

from Janet Systems

Padding
Copyright 2002-2008 Janet Systems Ltd.   Terms Of Use  Privacy Statement Tuesday, May 13, 2008