I want a list
Item 1 up
Item 2 up
that will be shortable and when you drag item 2 to make the green div come above the red div. meaning is z-index will be higher!
is my link to see it working so far..
http://jsfiddle.net/2vgRY/
Thanks guys in advance!
EDIT:
just one last thing! when i place a 3rd item and place it above the 2nd i want the first one to still be on the top then the 3rd, then the 2nd.. http://jsfiddle.net/2vgRY/3/
its like a sorting thing , you draf item 3 up then div 3 comes up, you drag item 2 bellow item 1 then div 1 is first then div 2 bellow it then div 3 last ..
If I’ve understood your question correctly, you can use jQuery UI sortable() start event:
See this working Fiddle Example!
JQUERY
HTML
Note that I’ve added the class
item_xand the classtarget_xto allow the elements identification.