Skip to content

Instantly share code, notes, and snippets.

@btspoony
Created February 28, 2012 21:42
Show Gist options
  • Save btspoony/1935335 to your computer and use it in GitHub Desktop.
Save btspoony/1935335 to your computer and use it in GitHub Desktop.
JS Open New Window
var UserAuth = {
openAuth: function(url) {
var top = (document.body.clientHeight - 420) / 2;
var left = (document.body.clientWidth - 520) / 2;
window.open(url, 'connect_window', 'height=400, width=560, toolbar =no, menubar=no, '
+ 'scrollbars=yes, resizable=no,top=' + top + ',left=' + left + ', location=no, status=no');
},
login : function (type) {
switch (type) {
case 'sina':
UserAuth.openAuth('/auth_sina?display=window'); break;
default: break;
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment