Recommended: JS DIV simulates SELECT form domain Recently I am working on an AJAX project, which uses many simulated screen locks with a full screen layer, but there is a headache, that is, the drop-down list box will always be displayed on the layer. In order to solve this problem, I wrote this JS class. I personally feel it is very useful, so I will share it with you here.
Popups will appear when entering some websites while surfing the Internet. It may be a kind greeting from the webmaster to you, or it may be an important announcement of the website, website advertisements, etc. But if you use it poorly, it will make people feel bored. How can pop-ups work without affecting the viewer's browsing page?
Generally, you need to close it, and the viewers will definitely find it very troublesome. How great it would be if it could be turned off by itself. It is actually very simple to achieve this effect.
1. First, add the following program to the <head ></head > area.
| The following is the quoted content: < 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 = 'CuoXIn.htm'; } // -- > < /script > |
2. Create a new CuoXIn.htm file (that is, the file used in the popup window), and this file name must be consistent with the file name set in popup.location.href = 'CuoXIn.htm' above.
3. Edit the newly created file CuoXIn.htm (note that CuoXIn.htm should be in the same directory as the main page file). First change <body bgcolor=#FFFFF text=#000000> to <body bgcolor=#fef4d9 onload=closeit()>, and then add between <body >< /body >:
| The following is the quoted content: < script language=JavaScript > function closeit() { setTimeout(self.close(), 10000) } < /script > |
Note: 10000 in the penultimate line refers to how long it takes to close (can be modified as needed), 10000 is 10 seconds. In this way, the pop-up window will automatically close after 10 seconds, and the viewer does not need to pay attention to it.
Share: ASP generates basic code for static htm pages Official reference manual, authoritative technical manual download electronic book tutorial classification The following dotted box is the specific code of the mk.asp file: ----------------------------------------------------------------------------------------------- -------------------------------------------------- -----