This is driving me nuts. I'm a copy/paste kind of guy(!) so please be gentle.
Previously, I've used this solution (Stack link) to make a centered popup which has worked perfectly (on in internal CMS site) but for some reason, I can't get it to work on a new site (not on the CMS).
I know I'm missing something but I just can't see what it is!!
HTML:
<a class="twitter" href="https://twitter.com" onclick="PopupCenter(this.href,'myWindow','550','550');return false" target="_blank">Center Popup</a>
Javascript:
function PopupCenter(url, title, w, h) {
// Fixes dual-screen position Most browsers Firefox
var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left;
var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top;
width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;
var left = ((width / 2) - (w / 2)) + dualScreenLeft;
var top = ((height / 2) - (h / 2)) + dualScreenTop;
var newWindow = window.open(url, title, 'scrollbars=yes, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
// Puts focus on the newWindow
if (window.focus) {
newWindow.focus();
}
}