In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "JavaScript how to make pop-up windows more considerate". In daily operation, I believe many people have doubts about how JavaScript makes pop-up windows considerate. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the questions of "how JavaScript makes pop-up windows become considerate". Next, please follow the editor to study!
When you enter some websites when surfing the Internet, pop-up windows will appear. It may be a cordial greeting from the webmaster to you, or it may be an important notice or advertisement of the website. But it can be boring if you don't use it well. How to make the pop-up window work without affecting the viewer's browsing of the page?
The general pop-up window requires you to close it, the viewer will find it troublesome. If only it could shut itself down. It's actually very simple to achieve this effect.
1. First, add the following program to the
< head > < /head >In the area.
< 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 should be the same as the file name set in "popup.location.href = 'dogQ.htm'" above.
3. Edit the newly created file dogQ.htm (note that dogQ.htm should be in the same directory as the main page file). Put it first.
< body bgcolor="#FFFFFF" text="#000000" >Change to
< body bgcolor="#fef4d9" onload=closeit()" >And then in the
< body > < /body >Add between:
< 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), and 10000 is 10 seconds. In this way, the pop-up window will automatically close after 10 seconds, and the viewer does not need to ignore it.
At this point, the study on "how JavaScript makes pop-up windows more considerate" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.