如何更改可排序对象上的可拖动对象? 如何动态更改动态大小的可排序占位符?
$(function() {
$( ".block" ).draggable({
cursor: 'move',
connectToSortable: ".sortable",
helper: function () {
return createContainer();
}
});
$(".sortable").sortable({
opacity: .35,
forcePlaceholderSize: true,
start: function(e,ui){
ui.placeholder.height(ui.item.height());
},
stop: function (e, t) {
$(t.item).replaceWith(createContainer());
}
});
//$( ".sortable" ).disableSelection();
var createContainer = function () {
var el = $('<div class="block-new">replace</div>');
return el;
};
});