I've encountered an issue in my code where setAttribute and .transform are not working as expected. I have tried using them within the ondrop event function, but with no success.
interact('.dropzone')
.dropzone({
// Setting the required element overlap for a drop to be possible
overlap: 0.75,
// Listening for drop related events:
ondropactivate: function (event) {
// Providing active dropzone feedback
event.target.classList.add('drop-active')
},
ondragenter: function (event) {
var draggableElement = event.relatedTarget
var dropzoneElement = event.target
// Indicating the possibility of a drop
dropzoneElement.classList.add('drop-target')
draggableElement.classList.add('can-drop')
},
ondragleave: function (event) {
// Removing drop feedback style
event.target.classList.remove('drop-target')
event.relatedTarget.classList.remove('can-drop')
},
ondrop: function (event) {
console.log("here")
event.relatedTarget.setAttribute('resize-drag', 'width:100px')
event.relatedTarget.setAttribute('resize-drag', 'height:100px')
},
ondropdeactivate: function (event) {
// Removing active dropzone feedback
event.target.classList.remove('drop-active')
event.target.classList.remove('drop-target')
}
})