Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery UI sortable: how to leave the original visible until the drop?

In the standard behavior demonstrated at http://jqueryui.com/demos/sortable/ when you drag an item in the list a placeholder element is displayed where the item would be dropped.

However, the original location of the item to be dropped is not indicated.

I would like to leave the original location visible until the drop, so that the visual feedback is analogous to the way the original is left in place for the "semi-transparent clone" option depicted at http://jqueryui.com/demos/draggable/#visual-feedback

Is there any way I can do this with sortable?

Thanks!

like image 910
brahn Avatar asked Jan 27 '10 19:01

brahn


1 Answers

So one approach that seems to work (thought it's definitely a hack) is to pass the option

start: function (e, ui) { ui.item.show();}

which unhides the automatically hidden original (ui.item).

And, more generally, one can use the start function to modify the item.

like image 66
brahn Avatar answered Oct 14 '22 18:10

brahn