Why my dragging is not working | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
29th Aug 2020, 8:29 AM
Shivam Rawal
2 Respuestas
+ 5
"drags", "drag" and "drop" functions are not global: they are only available in the window.onload scope. Remove window.onload, you don't need it in this case. The target element (div) should be the one listening for the drop event, not the dragged element (img). I am using my phone at the moment so I cannot test the code further.
29th Aug 2020, 9:14 AM
Kevin ★
+ 1
Tysm
30th Aug 2020, 6:50 AM
Shivam Rawal