Javascript:window.open pop-up window position problem _javascript tips

Source: Internet
Author: User
Window.Open the position of the pop-up window. Record
Copy Code code as follows:

<script language= "JavaScript" >
<!--
window.open (' page.html ', ' newwindow ', ' height=100, width=400, Top=0, left=0, Toolbar=no, Menubar=no, Scrollbars=no, Resizable=no,location=n o, Status=no ')//This sentence is to be written in one line
-->
</SCRIPT>

Parameter explanation:

<script language= "javascript" > JS script started;
window.open the command to eject a new window;
The filename of the ' page.html ' pop-up window;
' NewWindow ' pop-up window name (not filename), not required, available null ' instead;
height=100 window height;
width=400 window width;
The pixel value of the Top=0 window from the top of the screen;
The pixel value of the left=0 window from the left side of the screen;
Toolbar=no whether the toolbar is displayed, yes for display;
Menubar,scrollbars represents the menu bar and scroll bar.
Resizable=no whether to allow changes to the window size, yes to allow;
Location=no whether the address bar is displayed, yes is allowed;
Status=no whether the information in the status bar is displayed (usually the file is open), yes to allow;
</SCRIPT> JS script End

Echo-->
Copy Code code as follows:

<script type= "Text/javascript" >
Function Neww () {
var W=document.getelementbyid (' W '). Value;
Alert (w);
var H=document.getelementbyid (' H '). Value;
var Hh=document.getelementbyid ("hh"). Value;
var V=document.getelementbyid (' V '). Value;
var style= "directories=no,location=no,menubar=no,width=" +w+ "height" +h;
var myfunc=window.open ("Http://www.baidu.com", "Nwindow", style);
Myfunc.moveto (HH,V);

}
</script>
<body>
New Window height: <input type= "text" id= "H" size= "4 "Value="/>
The width of the new window: <input type= "Text" id= "W" size= "4" value= "Y"/>
The vertical coordinates of the new window: <input type= "Te XT "Id=" hh "size=" 4 "value="/>
The horizontal coordinates of the new window: <input type= "text" id= "V" size= "4" value= ""/>
<bu Tton onclick= "New ();" > Open Heart Window </button>
</body>

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.