I’m trying to use jQuery UI sortable (http://jqueryui.com/demos/sortable/) on a page to drag’n’drop sort a couple of DOM elements. All elements have absolute positioning and this is where the problems start. It seems that jQuery UI thinks that all of the li’s are placed in the top left corner (that’s where the placeholder ends up anyway).
I created a jsfiddle here: http://jsfiddle.net/winter/4ePe6/ where the problem is quite hands on.
What I want to achieve is the following: When item 1 is dropped between item 2 and 3, item 2 is moved to where item 1 was, item 1 takes item 2:s place and item 3 and up stays where they are. Before dropping the placeholder shows where item 1 will be placed when dropped, i.e. the actual moving of item 2 occurs before the dropping.
Thanks in advance.
Solved this by skipping the absolute placements and worked it out with padding between the li’s and an absolute positioned div-wrapper around the ul.