Last active
September 11, 2017 17:09
-
-
Save dvlden/3485bcdd91f313c8509f to your computer and use it in GitHub Desktop.
Open link(s) in small browser dialog or new tab on phones/tablets
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
<a | |
href="https://google.com" | |
onClick="return popThis(this.href, 500, 370)"> | |
Open Google | |
</a> |
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
function popThis (u, w, h) { | |
var url = u, | |
width = w, | |
height = h, | |
leftPosition = (window.screen.width / 2) - ((width / 2) + 10), | |
topPosition = (window.screen.height / 2) - ((height / 2) + 50); | |
window.open(// -> | |
url, 'popUpWindow', | |
"height = " + height + ", " + | |
"width = " + width + ", " + | |
"left = " + leftPosition + ", " + | |
"top = " + topPosition + ", " + | |
"screenX = " + leftPosition + ", " + | |
"screenY = " + topPosition + ", " + | |
"resizable = no, status = no, toolbar = no, menubar = no, scrollbars = no, location = no, directories = no" | |
// <- | |
); | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment