Created
February 7, 2017 21:12
-
-
Save paulthegeek/5337493e02b27cf6851a2544cf29a618 to your computer and use it in GitHub Desktop.
Snippet to prevent loading images when you drag them onto a browser window. To prevent the image or video taking over the entire browser screen.
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
$window.addEventListener('dragover',function(e){ | |
e.preventDefault(); | |
}, false); | |
$window.addEventListener('drop',function(e){ | |
e.preventDefault(); | |
}, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment