When surfing the Internet, some websites will pop up. It may be a kind greeting from the webmaster, or an important announcement or advertisement on the website. However, poor use will make people bored. How can I make the pop-up window take effect without affecting the browser's page browsing?
You need to close the pop-up window. It would be nice if it could be disabled by itself. To achieve this effect is actually very simple,
1. FirstProgramAdd to the
<Script language = "JavaScript">
<! --
VaR GT = Unescape ('3e ');
VaR popup = NULL;
VaR over = "launch pop-up Navigator ";
Popup = Window. Open ('', 'popupnav', 'width = 225, Height = 235, resizable = 1, scrollbars = auto ');
If (popup! = NULL ){
If (Popup. Opener = NULL ){
Popup. Opener = self;
}
Popup. Location. href = 'dogq.htm ';
}
// -->
</SCRIPT>
2. Create a New dogq.htm file (that is, the file used in the pop-up window). The file name must be consistent with the file name set in "Popup. Location. href = 'dogq.htm'" above.
3. Edit the new file dogq.htm(?dogq.htm must be in the same directory as the home page file ). Change <body bgcolor = "# ffffff" text = "#000000"> to <body bgcolor = "# fef4d9" onLoad = "closeit ()">, add the following content between <body> </body>:
<Script language = "JavaScript">
Function closeit (){
SetTimeout ("self. Close ()", 10000)
}
</SCRIPT>
Note: The 10000 in the last three rows indicates that the service is closed for too long (which can be modified as needed), and the 10000 value is 10 seconds. In this way, the pop-up window will be automatically closed in 10 seconds, and the viewer does not need to handle it.