How to put cursor: move in a draggable div with javascript?

2

I have the following excerpt of a div

<div class="teste" draggable="true">CONTEÚDO DA DIV</div>

I would like that when I drag this div on the screen the cursor would be in default, but the problem is that only with CSS I can not because the cursor is as if it were locked! and I have developed code in jQuery , without UI , so I do not have access to functions like draggable()

    
asked by anonymous 03.05.2017 / 22:12

1 answer

3

There is no API to change cursor of an element that is in drag with HTML5. Maybe this will be possible with the upcoming CSS4 with pseudo-selectors for drag ... < p>

If you want to control the cursor you have to do drag with "old" JavaScript by changing the position of the element with the coordinates of the event.

For these cases, the cursor image can be changed with CSS like this:

cursor: nome-do-tipo-de-cursor;

and the options are:

To force a style you can still use !important;

    
03.05.2017 / 22:32