Jquery sorted by drag & drop

I am using jQuery sortable plugin, my question is this:

When I drag an element, as soon as I find the specified element with the one I am dragging, I want the function to be triggered. Remember that when I find an element with the mouse, but with the element I am dragging.

Thanks so much for any help I get with this problem :)

+4
source share
2 answers

Bind event after sortstart quits

 $( ".selector" ).sortable({ start: function() { $('#elementThatWillBeHoveredOver').hover(hoverStart, hoverEnd); } stop: function() { $('#elementThatWillBeHoveredOver').off('hover') } }); 
0
source

pt_BR

Eu estava com o mesmo problema que você. Tentei varias alternativas uma delas com o método "Droppable", the existing um plugin makes JQuery Droppable.

RU:

I had the same problem as you. I tried several alternatives one with the "Droppable" method, there is a jQuery Droppable plugin.

https://api.jqueryui.com/droppable/

 $( ".Permissoes > div" ).droppable({ over: function(event, ui){ console.log('fn:over',event,ui); }, out: function(event, ui){ console.log('fn:out',event,ui); }, drop: function(event, ui){ console.log('fn:drop',event,ui); } ); 
0
source

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


All Articles