1.js
Copy Code code as follows:
<script type= "Text/javascript" >
function Openwindow (url,name,iwidth,iheight)
{
URL to the address of the Web page
Name of the page, nullable
Iwidth the width of the pop-up window
Iheight the height of the pop-up window
Window.screen.height Gets the high screen, Window.screen.width gets the width of the screen
var itop = (window.screen.height-30-iheight)/2; Gets the vertical position of the window;
var ileft = (window.screen.width-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 ');
}
</script>
2. Calling methods
Copy Code code as follows:
<a href= "javascript:void (0);" onclick= "Javascript:openwindow (' a.html ', ', ', 400,200);" > Go to a</a>