Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I just had a moment of clarity after struggling with jQuery UI's (ahem) sparse documentation.</p> <p>The droppable option 'greedy' determines where an object will land when it's dropped on a tree of droppable objects.</p> <p>When set to false (the default) the dropped object will land on the lowest droppable object in the tree. When set to true the dropped object will land on the first (i.e. highest) droppable object in the tree.</p> <p>This can be demonstrated using the following mark up by way of example. Imagine the following divs are all droppable objects...</p> <pre><code>&lt;div id="bottom_container"&gt; &lt;div id="level_2_container"&gt; &lt;div id="level_3_container"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>A draggable object (given id="all_new_container" below) is dropped on div#level_3_container. Here's the markup that results if greedy is false (i.e. the default)...</p> <pre><code>&lt;div id="bottom_container"&gt; &lt;div id="level_2_container"&gt; &lt;div id="level_3_container"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="all_new_container"&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>And here's the markup that results if greedy is set to true...</p> <pre><code>&lt;div id="bottom_container"&gt; &lt;div id="level_2_container"&gt; &lt;div id="level_3_container"&gt; &lt;div id="all_new_container"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>If you have Firebug you watch the above happening as you drop objects into other objects here... <a href="http://acarna.com/editor.php" rel="nofollow">http://acarna.com/editor.php</a></p> <p>Please excuse the positioning bug that has new dropped elements land in the wrong place beyond level 2. I won't be fixing that in the above example, and it's not necessary to do so for the above demonstration.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload