JQuery UI Draggable - need to modify an item when dragging

I play with the drag and drop function for the first time, so I'm not quite sure what I am doing!

I need to add a class to the portlet while it is being dragged. I don’t want to use the clone function because I want the user to drag the actual item, I just want to assign the item while it is dragging and reset when it is deleted.

Does anyone help?

+3
source share
2 answers

, - beforedrag ', ? , , .

jQuery UI, start " :

http://docs.jquery.com/UI/Draggable#events

+3

, "helper" :

helper : function(ev, el) {
  return ($(el).clone().addClass("beingDragged"));
}

, , , :)

+1

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


All Articles