如何在jquery UI上获得可以使用over进行排序的接收列表?

时间:2015-09-16 10:23:14

标签: jquery-ui

我使用类似的东西: jquery ui sortable connect lists 我希望得到关于过度事件的接收列表。 这是我的代码:

    $( ".connectedSortable" ).sortable({
        connectWith: ".connectedSortable",
        cursor: "move",
        over : function(event, ui){
        //there is ui.sender but not receiver 
     }

}).disableSelection();

我可以不使用可排序的小部件吗?

1 个答案:

答案 0 :(得分:1)

接收列表将是event target功能的thisover。您可以像这样访问它:

 $( ".connectedSortable" ).sortable({
        connectWith: ".connectedSortable",
        cursor: "move",
        over : function(event, ui){
            var receiver = event.target;//or this. Both will get you the HTML element, 
                                        //use $(event.target)/$(this) if you want the jquery object
     }

}).disableSelection();