Web page javascript essence code set_basic knowledge
WBOY
Release: 2016-05-16 19:20:11
Original
1046 people have browsed it
[1. Ordinary pop-up window]
works on some older browsers. In these old browsers, the code in the tag will not be displayed as text
Come out. You can use either single quotes or double quotes, just don't mix them.
【2. Pop-up window after setting】
Parameter explanation:
End of js script 【 3. Use functions to control pop-up windows] The following is a complete code.
.....
A function openwin() is defined here, how to call it? Method 1: A window pops up when the browser reads the page; Method 2: A window pops up when the browser leaves the page; Method 3: Call with a link: Method 4: Call with button:
[4. Pop up 2 windows at the same time] Slightly change the source code:
To avoid pop-up The two windows are covered. Use top and left to control the pop-up position so that they do not cover each other. Finally, use the four methods mentioned above
to call it. Note: The names of the two windows (newwindows and newwindow2) should not be the same, or they should all be empty.
[5. The main window opens the file 1.htm, and the small window page.html pops up at the same time] The following code is added to the main window area:
Join the area:
open .
[6. Timing closing control of pop-up windows] Now let’s control the pop-up windows, and the effect will be better. If we add a small piece of code to the pop-up page ( note that it is added to the HTML of page.html, not the main page, otherwise...), let it close automatically after 10 seconds, right? Cooler? First, add the following code to the area of the page.html file:
Then, use the sentence [7. In the pop-up Add a close button to the window]
[8. Pop-up window included - two windows on one page] Through the following example, you can complete the above effect in one page.
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn