
Untitled
By: a guest on
Apr 25th, 2012 | syntax:
None | size: 0.47 KB | hits: 17 | expires: Never
jQuery UI drop event of droppable fires on sortable
$('#sortable').sortable().droppable({
// Drop should only fire when a draggable element is dropped into the sortables,
// and NOT when the sortables themselves are sorted (without something being dragged into).
drop: function(ev, ui){
$(ui.draggable).html('<div>TEMPLATE</div>');
}
});
$('#draggables li').draggable({
connectToSortable: '#sortable',
helper: 'clone',
revert: 'invalid',
cursor: 'move'
});