1. js
Copy codeThe Code is as follows:
<Script type = "text/javascript">
Function openwindow (url, name, iWidth, iHeight)
{
// The url to the webpage address
// Name the webpage name, which can be blank
// The width of the iWidth pop-up window
// The height of the iHeight pop-up window
// Window. screen. height obtains the screen height, and window. screen. width obtains the screen width.
Var iTop = (window. screen. height-30-iHeight)/2; // obtain the vertical position of the window;
Var iLeft = (window. screen. width-10-iWidth)/2; // obtain 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. Call Method
Copy codeThe Code is as follows:
<A href = "javascript: void (0);" onclick = "javascript: openwindow('a.html ','', 400,200); "> go to a </a>