Skip to content

Instantly share code, notes, and snippets.

@jamiehs
Created April 16, 2014 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamiehs/10893418 to your computer and use it in GitHub Desktop.
Save jamiehs/10893418 to your computer and use it in GitHub Desktop.
function openPopup(href, title, width, height){
var left = screen.availLeft + screen.width/2 - width/2,
top = screen.height/2 - height/2;
window.open(href, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + width + ', height=' + height + ', top=' + top + ', left=' + left);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment