accessing the element that was dragged (with sortable)
So, I have several lists (<ol>), and I made the <li> elements sortable, within the same list, and also between the lists (they're connected).
What I'm trying to do, is having a function when the <li> element is dragged in the same list, and a different one when it is dragged to other list.
This is what I have:
- $(ol).sortable({ placeholder: 'ui-state-highlight', handle: '.liHandler',
- connectWith: '.list ol', opacity: 0.6, containment: listsContainer,
- update: function()
- { updateElementsOrder(ol, ol.parentNode); },
- receive: function()
- {
- //when the element is dragged to other list
- //this points to the new <ol>
- }
- });
So, I can have access to the new list (<ol>), but I'm not seeing a way to know which element was dragged.
Basically I want to have access to the <li> element that was dragged (or the handle, works too).
Anyone knows how to do it?