How to disable drag and drop event using jquery?

i wan to disable the drag event using jquery and want to bind one event to the same mouse event, but it displays an error

I have a binding even before

<div class="mydiv"></div>

and i used

jQuery('.mydiv').draggable("destroy");

it disables the drag event and adds another functionality to the mouse down

but when I click on the div and dragging the cursor, then an error appears

$(this).data("draggable") is undefined
[Break on this error] var t = $('body'), o = $(this).data('draggable').options; 

and this is in ui.draggable.js,

Any buddy have any idea about this ??

+3
source share
1 answer

, , . , ui-draggable :

jQuery('.mydiv').removeClass("ui-draggable");

, .

-2

Source: https://habr.com/ru/post/1744121/


All Articles