Created
March 15, 2014 21:37
-
-
Save chrisjhoughton/9574275 to your computer and use it in GitHub Desktop.
Open a JavaScript popup window in the center of the screen. Kudos to http://stackoverflow.com/questions/4068373/center-a-popup-window-on-screen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var popupwindow = function (url, title, w, h) { | |
var left = (screen.width/2)-(w/2); | |
var top = (screen.height/2)-(h/2); | |
return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment