详细说明:
按照排序拖拽,可以在指定的框内拖拽$('.drag').draggable({ appendTo: 'body', helper: 'clone' }); $('#dropzone').droppable({ activeClass: 'active', hoverClass: 'hover', accept: ":not(.ui-sortable-helper)", // Reject clones generated by sortable drop: function (e, ui) { var $el = $('' + ui.draggable.text() + '
'); $el.click(function () { $(this).detach(); }); $(this).append($el); } }).sortable({ items: '.drop-item', sort: function() { // gets a dded unintentionally by droppable interacting with sortable // using connectWithSortable fixes this, but doesn't allow you to customize active/hoverClass options $( this ).removeClass( "active" ); } }); ...展开收缩