Possible Duplicate:
Center a popup window on screen?
I have 4 different links, all of which need to open a new window which will target 4 different html files.
When the links are clicked, it needs to open the html file in question in a new window, both:
I have found this below, but it doesnt seem to cater for centering of the window
http://jquerybyexample.blogspot.com/2012/05/open-link-in-new-tab-or-new-popup.html
Cheers
To center the new window, give it a left and top value half of the screen size - half of the window size :
var left = ($(window).width()/2)-(900/2),
top = ($(window).height()/2)-(600/2),
popup = window.open ("", "popup", "width=900, height=600, top="+top+", left="+left);
FIDDLE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With