Skip to content

Instantly share code, notes, and snippets.

@pstrinkle
Created June 13, 2016 15:31
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 pstrinkle/6ff1c758bfd4cd86f0247ef60e45738d to your computer and use it in GitHub Desktop.
Save pstrinkle/6ff1c758bfd4cd86f0247ef60e45738d to your computer and use it in GitHub Desktop.
/**
* launch_popup
*
* Launch a popup for the url provided.
*/
function launch_popup(url) {
var wwidth = $(window).width();
var wheight = $(window).height();
var width = (wwidth > 600) ? 600 : wwidth - 50;
var height = (wheight > 650) ? 650 : wheight - 50;
var options = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width="+width+",height="+height+",left=20,top=20";
popup = window.open(url, "", options);
popup.creater = top;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment