restructured

This commit is contained in:
Karan 2021-12-03 14:24:15 +05:30 committed by GitHub
parent 83503d703b
commit 2a53d6ae60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,15 +25,15 @@
const dragme = document.querySelector("#dragme");
dragme.addEventListener("dragstart", (e) => {
dragme.style.opacity = .5;
})
});
dragme.addEventListener("dragend", (e) => {
dragme.style.opacity = "";
})
});
const boxes = document.querySelectorAll(".box");
boxes.forEach(box => {
box.addEventListener("dragenter", (e) => {
e.target.classList.add('red');
})
});
box.addEventListener("dragover", (e) => {
e.preventDefault();
});
@ -46,7 +46,7 @@
console.log("dropped");
e.target.appendChild(dragme);
});
})
});
function dragStart(e) {
console.log("Started");
}