issues with mouse cursor on dragstart event.

So im trying to get rid of the default style (o with line at 45deg) when dragging .. so i used e.preventdefault(). now im having the issue where styling is not being applied for the div thats being dragged ie red background colour . how to fix this?
6 Replies
Jochem
Jochem2y ago
as always, a codepen is better than screenshots that said, you're using e.preventDefault without declaring e as an argument the rest of the function probably doesn't run anymore after you get a "trying to call preventDefault on undefined" error
Avinash
AvinashOP2y ago
https://codepen.io/avinash-tallapaneni/pen/dygGrjR i dont what the default cursor to be shown when dragging
Jochem
Jochem2y ago
do you want to hide it completely? or just change it to something else?
Avinash
AvinashOP2y ago
i want to change it something other than o/
Jochem
Jochem2y ago
that's there because you don't have an element with a ondrop and ondragover handler, it'll be the more default dragging cursor (default arrow with a box next to it) if you implement those Take a look at the MDN docs, they explain a lot about how dragging and dropping works https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API
Avinash
AvinashOP2y ago
i will add those thumbup
Want results from more Discord servers?
Add your server