Thinking in Peak
是技术?是信息?还是思想?! 是垃圾?是堆积?还是思想?! Version:1.2
Page layout from PHP& More
 Peak.name

Home | About me | Life history | Mood story | >>Thinking in Peak | My Diary | Photography | Project | Contact me

Neighbor

<< November 14, 2004 - November 20, 2004


Main


February 27, 2005 - March 05, 2005 >>

Search


Categories
Recent Archives
February 12 - February 18
November 20 - November 26
July 31 - August 06
July 24 - July 30
June 26 - July 02
May 29 - June 04
March 27 - April 02
February 27 - March 05
January 09 - January 15
November 14 - November 20
>>> All archives <<<
Links
24hour online
Charset.org
Peak Jing's home page
Peak正在读看听...

BlogBus.Com
东方网景商务网站
超越PHP

美丽新世纪
wendy's Space
avenger::Blog()
Lemon & YB
Snoopy Home
Donna's Story
ZhaoJMan : My Eye(s)
混混程序员
Raid Cheng's Blog
Boyan.net
一个军人的旅程

IBUZZO, THE SOCIALIST
De Dream
人生攻略
海风乱吹
妖蛊
ByBye

跳舞的小蚂蚁
小三摄影
Momoko World
车东BLOG
LEON也博客
Vol de Nuit
Eosin的什锦糖果盒子
fanroc的凡人生活
1-Game@第1游戏
Tools
Recent Comments
Share bookmarks
Syndicate this site (XML)
Free Guestmap from Bravenet.com

Count :
Powered by MT3.11



January 11, 2005


setTimeout Method( From MSDN Library)

setTimeout Method

Evaluates an expression after a specified number of milliseconds has elapsed.

Syntax

iTimerID = window .setTimeout( vCode , iMilliSeconds [ , sLanguage ] )

Parameters

vCode Required. Variant that specifies the function pointer or string that indicates the code to be executed when the specified interval has elapsed.
iMilliSeconds Required. Integer that specifies the number of milliseconds.
sLanguage Optional. String that specifies one of the following values:
JScript Language is JScript.
VBScript Language is VBScript.
JavaScript Language is JavaScript.

Return Value

Integer. Returns an identifier that cancels the evaluation with the clearTimeout method.

Remarks

In versions earlier than Microsoft® Internet Explorer 5, the first argument of setTimeout must be a string. Evaluation of the string is deferred until the specified interval elapses.

As of Internet Explorer 5, the first argument of setTimeout can be a string or a function pointer.

The specified expression or function is evaluated once. For repeated evaluation, use the setInterval method.

When you use the setTimeout method with Introduction to DHTML Behaviors , the value of vCode should be a function pointer to call a function within the HTML Component (HTC) file or a string to call a function in the primary document.

Examples

The following example uses the setTimeout method to evaluate a simple expression after one second has elapsed.

window. setTimeout ("alert('Hello, world')", 1000);

The following example uses the setTimeout method to evaluate a slightly more complex expression after one second has elapsed.

var sMsg = "Hello, world"; window. setTimeout ("alert(" + sMsg + ")", 1000);

This example uses the setTimeout method to hide a input type=button object after three seconds. If the user clicks the Count Down button and then counts to three, the Now You See Me button disappears.

<SCRIPT> function fnHide(oToHide){ window. setTimeout ("fnHide2(" + oToHide.id + ")", 3000); } function fnHide2(sID){ var o = eval(sID); o.style.display="none"; } </SCRIPT> <INPUT TYPE=button VALUE="Count Down" ID="oHideButton" onclick="fnHide(this)">

This example uses a function pointer to pass the data. In this case, the data is stored in a global variable because it cannot be passed directly. In the preceding example, the ID of the button is passed as a parameter to the function invoked by the setTimeout method. This is possible only when a string is passed as the first argument.

 

Standards Information

There is no public standard that applies to this method.

Applies To

window Platform Version
Win16: 3.02
Win32: 3.02
Windows CE: 4.0
Unix: 4.0
Mac: 3.02
Version data is listed when the mouse hovers over a link, or the link has focus.
window
Move the mouse pointer over an element in the Applies To list to display availability information for the listed platforms. Internet Explorer does not expose this member on platforms that are not listed.
Posted by Peak at January 11, 2005 11:50 AM | Comments (0) | TrackBack (778)

Peak Jing Project

COPYRIGHT © Peak Jing 2003-2005
Powered By
Peak Jing

Valid HTML 4.01!