first I have a sortable container with class="viewport", then I want show each child’s id after be sorted, so the code:
$(".viewport").sortable({
connectWith: '.viewport',
revert: true,
stop: function () {
$sort_left_array=$(this).children();
$sort_left_arry.each(function(){
alert($(this).attr("id"));
});
}
});
but after sorted, in firebug, it alerts “this.helper is null”, the alert function doesn’t work, also the page’s all animate don’t work.
by the way the items in sortable container is loaded with ajax when the page is loading,in the $(function(){}) part at the head of the page, does that matter?
Has anyone had this problem before? How can I solve this problem?
There is a typo in the code in your question:
$sort_left_array != $sort_left_arry. Also, unless you’ve declaredvar $sort_left_arraysomewhere else in your code, you’re missing avarkeywork in thestopcallback.