Centered Popup

This popup script will be centered both horizontal and vertical.

Paste this between <head> and </head>

<script type="text/javascript">
function mypopup(url, width, height) {
var top = Math.round((screen.height-height)/2);
var left = Math.round((screen.width-width)/2);
window.open (url, 'newwindow','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, fullscreen=no, top=' + top + ', left=' + left + ', width=' + width + ', height=' + height);
}
</script>

You can configure this part as you like.

toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, fullscreen=no

Example link.

<a href="javascript:mypopup('http://xonium.net','700','500')">Xonium.net in popup</a>

Xonium.net in popup

Leave a comment

CAPTCHA image (Click the image to get a new one)