Javascript implements special effects code for delayed display in the prompt box and javascript special effects code
This example describes how to use setTimeout in JavaScript to implement a latency pop-up warning box. Share it with you for your reference. The details are as follows:
First, we will show you a JS Code for the latency/Timing/forced pop-up window.
Parameter description: Set Time: Then. setTime (Then. getTime () + 1*60*60*1000) http: // pop-up page in mylove/ttan.htm(transition webpage: ttan.htm/is the page to pop up scroll: 1 (scroll bar) status: 1 (status bar) help: 1 (help button) toolbar = 1 (toolbar) resizable: 1 (Can you drag the mouse to change the size) dialogWidth: 800px (width) dialogHeight: 600px (height) 3000 (delayed pop-up time, in milliseconds. 1 second = 1000 milliseconds) <! -- Pop-up advertisement --> <script language = "JavaScript"> function Get () {var Then = new Date () Then. setTime (Then. getTime () + 1*60x60*1000) var cookieString = new String (document. cookie) var cookieHeader = "Cookie1 =" var beginPosition = cookieString. indexOf (cookieHeader) if (beginPosition! =-1) {} else {document. cookie = "Cookie1 = POPWIN; expires =" + Then. toGMTString () focusid = setTimeout ("comment ','', 'scroll: 0; status: 0; help: 0; resizable: 0; dialogWidth: 0px; dialogHeight: 0px ') ", 3000) window. focus () ;}} Get (); </script> <! -- Pop-up and end --> ttan.htm content: <script language = "javascript"> <! -- Window. open ("http: // pop-up webpage/"); // --> </script> <script LANGUAGE = "JavaScript"> <! -- SetTimeout ('window. close (); ', 0) // --> </script> can be used to bring up a single IP address only once in a certain period of time. It can be delayed and forced to bring up !!
After the following code is executed, a warning box will pop up with a delay when you click the button, which mainly demonstrates how to use setTimeout.
<! DOCTYPE html>
Note the notes that need to be noted when writing the delayed prompt box. Note the notes one by one. After reading the video tutorial, this function is smooth, the reason is that a list of required functions is implemented one by one according to the list before writing the code. If there is a problem, it is much better to adjust the corresponding functions than to write the code directly.