Skip to content

Instantly share code, notes, and snippets.

@rafaelrinaldi
Created April 26, 2011 14:32
Show Gist options
  • Save rafaelrinaldi/942360 to your computer and use it in GitHub Desktop.
Save rafaelrinaldi/942360 to your computer and use it in GitHub Desktop.
A script that shows a popup in the middle of the screen.
function popup(p_url, p_title, p_width, p_height) {
var left = (screen.width * .5) - (p_width * .5);
var top = (screen.height * .5) - (p_height * .5);
var target = window.open(p_url, p_title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=' + p_width + ', height=' + p_height + ', top=' + top + ', left=' + left);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment