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

Untitled

By: a guest on Jul 18th, 2012  |  syntax: None  |  size: 0.30 KB  |  hits: 18  |  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 droppable: prevent parent from accepting children
  2. $( ".onedoc" ).droppable({
  3. accept: ".onedoc"
  4. });
  5.        
  6. accept: $(".onedoc").not($(this).children())
  7.        
  8. $( ".onedoc" ).droppable({
  9. accept: function(elem){
  10. // check elem here for being a child and return false
  11. return !this.has(elem).length;
  12. }
  13. });