I’m building a jQuery based tree menu using jQuery sortable(). Here is my current code: http://jsfiddle.net/8KDur/.
As you see, the sortable function works fine.
But, the ui-behavior while dragging a tree li-item over the other tree items doesn’t work the way I wish too. I want the li-items to stay still and the border between them highlight while dragging. Indicating between which items it will be placed.
So, how do I get the items to stay still while dragging?
I’d rather not use plugins for this.
You can use the
placeholderoption to specify a CSS class to use as the border between the items. Then, sethelperto'clone'which will create a duplicate of the list item you are dragging. By default, jQuery UI will hide the helper using an in-linedisplay: none, so it may be necessary to override that if you want the list item to remain visible and static.http://jsfiddle.net/8KDur/33/