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
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" errorhttps://codepen.io/avinash-tallapaneni/pen/dygGrjR
i dont what the default cursor to be shown when dragging
do you want to hide it completely? or just change it to something else?
i want to change it something other than o/
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
i will add those