JS only pops up a center pop-up window

Source: Internet
Author: User

Var newwindow;//defines a window that facilitates communication between Windows
function Makenewwindow (URL) {
   if (!newwindow | | newwindow.closed) {
        var width =;
        var height = 300;
        var left = parseint ((SCREEN.AVAILWIDTH/2)-(WIDTH/2));//center screen
         var top = parseint ((SCREEN.AVAILHEIGHT/2)-(HEIGHT/2));
        var windowfeatures = "Width=" + width + ", height=" + height + ", Status,resi Zable,left= "+ Left +", top= "+ Top +" screenx= "+ Left +", screeny= "+ top;
        newwindow = window.open (URL, "Subwind", windowfeatures);
   } else {
       //window is already open, so bring it to th E Front
        newwindow.focus ();
   }
}

window.open the command that pops up the new window;
page.html the filename of the popup window;
NewWindow the name of the pop-up window (not the file name), non-required, available empty ' ' 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 is displayed;
Menubar,scrollbars represents the menu bar and scroll bar.
Resizable=no whether the window size is allowed to change, yes is allowed;
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 already open), yes is allowed;

JS only pops up a center pop-up window

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.