'Add class in drop area (file input) when dragging an external image over
Hi how to add class using Jquery when I'm dragging element over drop area.
This is my HTML
<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>
I want to add class in upload div class something like this
<div class="upload dragging"></div>
Solution 1:[1]
To remove dragging class when you leave drag area you can add this to Mosh Feu code:
upload.addEventListener("dragleave", function( event ) {
this.classList.remove('dragging');
}, false);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Adrian-AGM |
