Changing the cursor while dragging

Can I change the cursor while dragging? I searched and tried to do this for a while. I want to change the "invalid" cursor that appears when dragging an object to another cursor.

I tried to create an event and assign it to the image that I wanted to drag: -

<img id="drag1" class="drag" src="http://www.surfixe.com/img/tick2.png" draggable="true" ondragstart="drag(event)" />

Java: -

function drag(ev) {
    $('#drag1').css('cursor', 'pointer');
}


jsfiddle

Edit: Note. My little project is suppost, which should be html-5 drag and drop, so I need to be able to change the cursor by dragging a div with html-5drag attribute

+5
source share
2 answers

" " , . img .draggable() http://api.jqueryui.com/draggable/ , .

,

$( "#drag1" ).draggable({ cursor: "pointer" });

http://jsfiddle.net/wpcbM/3/

+1

, . , ( ).

-1

All Articles