Skip to content

Instantly share code, notes, and snippets.

@paulthegeek
Created February 7, 2017 21:12
Show Gist options
  • Save paulthegeek/5337493e02b27cf6851a2544cf29a618 to your computer and use it in GitHub Desktop.
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.
$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