diff --git a/script.js b/script.js index 5e6c2cc..5fc094a 100644 --- a/script.js +++ b/script.js @@ -1,22 +1,28 @@ dropzone = document.getElementById('dropzone'); dropzone.addEventListener('dragover', function(e) { - e.preventDefault(); - this.classList.remove('nodrop'); this.classList.add('drop'); }); dropzone.addEventListener('dragleave', function(e) { - e.preventDefault(); - this.classList.remove('drop'); this.classList.add('nodrop'); }); -dropzone.addEventListener('click', function(e) { - e.preventDefault(); +dropzone.addEventListener('mousedown', function(e) { + this.classList.remove('nodrop'); + this.classList.add('drop'); + console.log('click'); +}); +dropzone.addEventListener('mouseup', function(e) { + this.classList.remove('drop'); + this.classList.add('nodrop'); + console.log('unclick'); +}); + +dropzone.addEventListener('click', function(e) { input = document.createElement('input'); input.type = 'file'; input.click();