Skip to content

Instantly share code, notes, and snippets.

@ozknozsrt
Last active February 6, 2017 10:53
Show Gist options
  • Save ozknozsrt/c85e18ea0c5a8eda0fe9ccfae50e824a to your computer and use it in GitHub Desktop.
Save ozknozsrt/c85e18ea0c5a8eda0fe9ccfae50e824a to your computer and use it in GitHub Desktop.
Dropzone addClass
<script>
var upload = document.querySelector('.upload');
upload.addEventListener("dragover", function( event ) {
this.classList.add('dragging');
}, false);
upload.addEventListener("drop", function( event ) {
this.classList.remove('dragging');
}, false);
</script>
<style>
.dragging {
border:1px solid green;
}
</style>
<div class="upload">
<form action="">
<input class="uploadfile" type="file" id="imageLoader" name="imageLoader">
<div class="circle"><i class="flaticon-arrows-1"></i></div>
<div class="text">Drag and Drop or browse from you computer</div>
</form>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment