Home > Web Front-end > JS Tutorial > window.open() pops up a centered window_Typical special effects

window.open() pops up a centered window_Typical special effects

WBOY
Release: 2016-05-16 19:20:03
Original
1586 people have browsed it

Javascript code

function openwindow(url,name,iWidth,iHeight)
{
var url; /Webpage name, can be empty;
var iWidth;                        //The width of the pop-up window; Get the vertical position of the window;
var iLeft = (window.screen.availWidth-10-iWidth)/2; //Get the horizontal position of the window;
window.open(url,name,'height=' iHeight ',,innerHeight=' iHeight ',width=' iWidth ',innerWidth=' iWidth ',top=' iTop ',left=' iLeft ',toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no ');
}

Just call this function when using it. Such as:

Go to a

Disadvantages: It has nothing to do with the size and position of the original window.

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template