JQuery Sortable () with original place position?

Is there a way for the jQuery sortable list to show the placeholder where the starting element was when dragging one of them to sort?

i.e. when the user proceeds to move one of the LIs in my list, I want the outline of the rectangle to show where it is being dragged from.

+3
source share
2 answers

Short version: you can use a sortable event handler startto open the source element and change its appearance as you like. For instance:.

$(listOfStuff).sortable({
  start: function (e, ui) { 
    ui.item.show().addClass('original-placeholder');
  });

, , , , "-".

( ):

  • start , .
  • , , . (ui.helper - , ). ui.item.show(), . (, , , .)
  • ui.item . , HTML ..

, , , .

+8

, , , , li , n- .

, , , , DOM, , , css 3- , , , , , , , , , .

, , - , ( ), . , , DOM , ...

0

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


All Articles