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

Asked

Viewed 175 times

2

I have the following excerpt from a div

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

I wish that when I drag this div By the screen the cursor was in default, but the problem is that only with CSS I can not because the cursor is as if locked! and tbm I developed the code in jQuery, without the UI, therefore I do not have access to functions such as draggable()

1 answer

3

No API to change the cursor of an element that is in drag with HTML5.
Perhaps this will be possible with the future version CSS4 with pseudo selectors for drag...

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

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

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

and the options are:

inserir a descrição da imagem aqui

To force a style you can still use the !important;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.