Skip to content Skip to sidebar Skip to footer

Upgrading To Jquery 1.7 And Changes To The Event Object

Ok this one through me for a loop, but I finally traced it down to changes in the event object parameter on callbacks. Let me outline the problem: I recently upgraded to jquery 1.

Solution 1:

You could use the jQuery method .closest() to find the list that the item belonged to.

$("#ulFeatured, #ulAvailable").sortable
(
    {
        connectWith: ".connectedSortable",
        receive: function (event, ui)
        {
            console.log($(event.target).closest('ul'));
        }
    }
).disableSelection();

Working example here

Post a Comment for "Upgrading To Jquery 1.7 And Changes To The Event Object"