Small Window University question-Playbox pop-up window (2)

Source: Internet
Author: User

[3. Function Control pop-up window]

The following is a complete code:
  
<Html> 〉
<Head> 〉
<Script LANGUAGE = "JavaScript"> "〉
<〈! --
Function openwin (){
Window. open ("page.html", "newwindow", "height = 100, width = 400, toolbar = no, menubar = no, scrollbars = no, resizable = no, location = no, status = no ")
// Write a row
}
// --> //--〉
</Script> 〉
</Head> 〉
<Body onload = "openwin ()"> ()"〉
... Any page content...
</Body> 〉
</Html> 〉

A function openwin () is defined here, and the function content is to open a window. There is no purpose before calling it.
How to call it?
 
Method 1: The window pops up when the browser reads the page;
 
Method 2: The window pops up when the browser leaves the page;
 
Method 3: call with a connection: <a href = "#" onclick = "openwin ()"> open a window </a> 〉
Note: "#" is a virtual connection.
 
Method 4: call with a button: <input type = "button" onclick = "openwin ()" value = "open window"> "〉

4. Two windows are displayed at the same time]

Slightly modify the source code:
<Script LANGUAGE = "JavaScript"> "〉
<〈! --
Function openwin (){
Window. open ("page.html", "newwindow", "height = 100, width = 100,
Top = 0, left = 0, toolbar = no, menubar = no, scrollbars = no, resizable = no,
Location = no, status = no ")
// Write a row
Window. open ("page2.html", "newwindow2", "height = 100, width = 100,
Top = 100, left = 100, toolbar = no, menubar = no, scrollbars = no, resizable = no,
Location = no, status = no ")
// Write a row
}
// --> //--〉
</Script> 〉
 
To avoid overwriting the two pop-up windows, use top and left to control the position of the pop-up window. Finally, use the four methods mentioned above to call.
Note: The names of the two windows (newwindows and newwindow2) must not be the same, or they are all empty. OK?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.