by MYLE
23. June 2010 17:10
One I don't like is when some create a popup window and it not in the center of the screen
so I wrote this Popup javascript function to do the job for me center it
function PopupIt2(url,width,Height)
//************************************************
// OPEN A POP WINDOW
//************************************************
{
// alert('h=' + window.screen.availHeight);
var popupWidth = (window.screen.availWidth / 2) - (width / 2);
var popupHeight = (window.screen.availHeight / 2) - (Height / 2);
var popupTop = popupHeight var popupLeft = popupWidth
// THANKS ROBIN MY SON FOR THE HELP FOR THIS
// alert('popupHeight = ' + popupHeight);
// alert("top=" + popupTop + " , left=" + popupLeft + " , width=" + width + " , height=" + Height + " location=No,scrollbars=yes,status=no,menubar=no");
popupwin = window.open(url, "new_page","top=" + popupTop + " , left=" + popupLeft + " , width=" + width + " , height=" + Height + " location=No,scrollbars=yes,status=no");
popupwin.focus();
}
add JavaScript:PopupIt2('url',width,height) to the href of the A
where the width is the width of the screen and the height been the height of the new popup
watch this space have and other one that will popup a Image the right size
have to find the code LOL
5a33326c-7d3a-4be7-85fb-3e3bcee8fbfd|0|.0