0

i have some problems with jquery sortable:

This is my code:

$('.sortable-list').sortable({
        helper: function (e, ui) { return $(ui.get(0)).clone().appendTo('body').css('zIndex', 5).show();},
        connectWith: '.sortable-list',
        placeholder: 'ui-state-highlight',
}).disableSelection();

i like to add a sourrounding div to the helper. But return '<div>'+$(ui.get(0)).clone().appendTo('body').css('zIndex', 5).show()+'</div>'; wont work.

Can somebody help please?

Thanks

4

1 回答 1

1

我认为您需要检查此选项:http ://api.jqueryui.com/sortable/#option-containment

编辑 :

你试过 JQuery 换行吗?

见这里:http ://api.jquery.com/wrap/ 你会做类似的事情:

$('.sortable-list').wrap('<div class="new" />');
于 2013-04-29T13:39:20.920 回答