Created
June 10, 2022 12:23
-
-
Save TomGrobbe/0fa8596a42a084398445bfc9c107f70f to your computer and use it in GitHub Desktop.
Open images in a new tab if you double click on them (does not support mobile devices).
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
document.addEventListener("dblclick", function (ev) { | |
if (ev.target.localName === "img") { | |
window.open(ev.target.currentSrc, "_blank"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment