Last active
October 25, 2021 09:51
-
-
Save VinnyFonseca/521174295dbc9d4037db to your computer and use it in GitHub Desktop.
New Popup Window
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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