setTimeout 的用法详细介绍
2008-02-23 07:58:05来源:互联网 阅读 ()
例子:
<SCRIPT>
var g_oToHide = null;
function fnHide(oToHide){
g_oToHide = oToHide;
window.setTimeout(fnHide2, 3000);
}
function fnHide2(sID){
if (g_oToHide) {
g_oToHide.style.display="none";
}
}
</SCRIPT>
<INPUT TYPE=button VALUE="Now you see me ..." ID="oHideButton"
onclick="fnHide(this)">
解释:
Evaluates an expression after a specified number of milliseconds has elapsed.
SyntaxiTimerID = 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:
|
