1.js
Copy the code code as follows:
<script type="text/javascript">
function openwindow(url,name,iWidth,iHeight)
{
// url redirects to the address of the web page
// name web page name, can be empty
// iWidth the width of the pop-up window
// iHeight the height of the pop-up window
//window.screen.height gets the height of the screen, window.screen.width gets the width of the screen
var iTop = (window.screen.height-30-iHeight)/2; //Get 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. Call method
Copy the code code as follows:
<a href="javascript:void(0);" onclick="javascript:openwindow('a.html','',400,200);">Go to a</a>