Skip to content

Instantly share code, notes, and snippets.

@erotte
Created August 24, 2009 07:47
Show Gist options
  • Save erotte/173723 to your computer and use it in GitHub Desktop.
Save erotte/173723 to your computer and use it in GitHub Desktop.
// ===================================
// = Bullet Proof Popups, 1997 style =
// ===================================
Popup: {
base: function(url, options, popupName){
popupName = window.open(url,popupName,options);
if (popupName){
if (popupName.focus) popupName.focus();
}
return false;
},
link_with_size: function(url, width, height) {
Popup.base(url, 'width='+width+',height='+height+',toolbar=0,menubar=0,resizable=1,scrollbars=1,status=1,left=200,top=100', name );
// return false would break usage with pseudo protocol (href="javascript:Popup.link_with_size()")
},
standard: function(url, name) {
Popup.base(url, 'width=550,height=650,toolbar=0,menubar=0,resizable=1,scrollbars=1,status=1,left=200,top=100', name );
return false;
}
// Add custom Popup wrapper methods
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment