Draggable/sortable, changing newly created elements
Hi everyone,
I'm using Draggable and Sortable in conjunction with one another. I'm having a bit of trouble with the receive event function with my sortable list. My code is as follows:
-
$("#list li").draggable({
connectToSortable: "#page ol",
containment: "window",
helper: "clone",
revert: true,
revertDuration: 0,
appendTo: "body"
});
$("#page ol").sortable({
handle: ".drag_handle",
receive: function(event, ui) {
$(ui.item).css('background','red');
}
});
What I was hoping this code would do is highlight in red each new list item that gets added to the sortable list. However it highlights the ones in the draggable list instead. How do I access the newly created list items in my sortable list?
Thanks in advance
Sam