Javascript / Popups / Centered Popup
open a popup in the center of the screen
General Details
Snippet uploaded by: snippet
Email : webmaster@snippetlibrary.com
Snippet By: Unknown
<!---Head--->
<script>
// open a popup centered on the screen
Function centerWindow(popupUrl, popupWidth, popupHeight){
If(window.screen){
var ah=screen.availHeight-30;
var aw=screen.availWidth-10;
var xc=(aw-popupWidth)/2;
var yc=(ah-popupHeight)/2;
Str =",left="+xc+",screenX="+xc;
Str +=",top="+yc+",screenY="+yc;
Str += ",width="+popupWidth+",height="+popupHeight;
}
previewWindow = window.Open(popupUrl,"","toolbar=0,location=0,menubar=0,scrollbars=1,status=0,resizable=1,width="+popupWidth+",height="+popupHeight+""+Str);
previewWindow.focus();
}
</script>
<!---Body--->
'Call it Like this
<a href="javascript:centerWindow('yourpage.html', 300, 200)">Open It</a>
No Reviews to show
