Skip to content

Instantly share code, notes, and snippets.

@VinnyFonseca
Last active October 25, 2021 09:51
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 VinnyFonseca/521174295dbc9d4037db to your computer and use it in GitHub Desktop.
Save VinnyFonseca/521174295dbc9d4037db to your computer and use it in GitHub Desktop.
New Popup Window
const popup = function (url, title, w = 640, h = 320) {
let l = (screen.width / 2) - (w / 2);
let t = (screen.height / 2) - (h / 2);
return window.open(url, title, `
toolbar=no,
location=no,
directories=no,
status=no,
menubar=no,
scrollbars=no,
resizable=no,
copyhistory=no,
width=${w},
height=${h},
top=${t},
left=${l}
`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment