Instance 002 timed Open Window Instance descriptionThis instance will open the window after the specified time. Technical EssentialsThe main application of the Window object settimeout () method to implement timed open windows. The syntax format for the SetTime () method is as follows.
<span style= "FONT-SIZE:14PX;" >settimeout (function,milliseconds) </span>
The parameters are described below. function: The name of the JavaScript custom function to invoke. milliseconds: Sets the time-out (in ms). function: The function is called after the timeout period has passed. This value can be cleared with the cleartimeout () function. Note: The SetTimeout () method calls the function only once after the time-out, and the SetInterval () method repeats the specified function at a certain time. implementation Process1. Create an ad page to open the window displaynew.html
2. Use function functions to create a custom pp () function, and apply the settimeout () method to implement a timed open window, the code is as followsindex.html<pre name= "code" class= "HTML" >
Note: The content of the style tag is the knowledge of CSS, and we focus on the content within the script tag. So this example of ours is done.
JavaScript Effect Instance 002-timed open Window