Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 25th, 2012  |  syntax: None  |  size: 0.47 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. jQuery UI drop event of droppable fires on sortable
  2. $('#sortable').sortable().droppable({
  3. // Drop should only fire when a draggable element is dropped into the sortables,
  4. // and NOT when the sortables themselves are sorted (without something being dragged into).
  5. drop: function(ev, ui){
  6.     $(ui.draggable).html('<div>TEMPLATE</div>');
  7. }
  8. });
  9. $('#draggables li').draggable({
  10.     connectToSortable: '#sortable',
  11.     helper: 'clone',
  12.     revert: 'invalid',
  13.     cursor: 'move'
  14. });​