Useful Stuff About:
Auto Centering Pop Up Window
This example is a typical pop up window that displays itself at the top left of the user's browser screen.
Click me of the image below to see the typical pop up window:
You do have the option to CENTER the pop-up window horizontally and vertically.
How do you do this? Paste the following JavaScript in the <head>
<script type="text/javascript">
function openPopUp(newPage,w,h) {
var windowName='newWindow';
var popUpX=(screen.width-w)/2;
var popUpY=(screen.height-h)/2;
var features='width='+w;
features=features+', height='+h;
features=features+', top='+popUpY+', left='+popUpX;
//You can change the the following if you wish
features=features+', scrollbar=yes';
features=features+', resizeable=no';
features=features+', toolbar=no';
features=features+', location=no';
features=features+', menubar=no';
features=features+', status=no';
window.open(newPage,windowName,features);
}
</script>
The text or image link needs to be as such below:
<a href="#"
onclick="openPopUp('pathToPage','pageWidth','pageHeight')"
>
Text or <img> tag in here
</a>