title: jQuery drag & drop and drag again
body: <p>I'm working on a drag &amp; drop page where you can drag elements from a list into various droppable containers. This works perfectly. What I am now trying to achieve is then have the ability to drag these from one container to another (or re-order them inside a container). But I cannot seem to do this.</p>
  
  <p>The list looks like a succession of coloured boxes with titles (each has a class name of '.item'). When you drag from the list it clones it, so that the list stays the same (ie. blocks are not removed). </p>
  
  <p>There are two containers (in this example), with class names of 'dragrow1' and 'dragrow2'. Depending on which row you drag your box into, the block will change appearance. This works as it should. The trouble is getting these boxes to drag again, either inside its own container or another one, and without cloning itself (it needs to move). By the way, the class name changes from '.item' to '.box' after dropping for style reasons. What's nice is as you drag a coloured box into a container, because of the css style applied, each box floats next to each other, so they lay side by side from the top left corner. </p>
  
  <p>My jquery code so far looks like this:</p>
  
  <pre><code>$(document).ready(function(){
  
    $(".items").draggable({helper: 'clone'});
  
    $(".dragrow1").droppable({
      accept: ".items, .box",
      hoverClass: 'dragrowhover',
      tolerance: 'pointer',
      drop: function(ev, ui) {
        var dropElemId = ui.draggable.attr("id");
        var dropElemTitle = ui.draggable.attr("title");
        $(this).append('&lt;div class="box" id="'+dropElemId+'row1"&gt;'+dropElemTitle+' - some extra box content here&lt;/div&gt;');
        $('div.box a').click(function(){$('#'+dropElemId+'row1').remove()});
      }
  
    });   
    $(".dragrow2").droppable({
      accept: ".items, .box",
      hoverClass: 'dragrowhover',
      tolerance: 'pointer',
      drop: function(ev, ui) {
        var dropElemId = ui.draggable.attr("id");
        var dropElemTitle = ui.draggable.attr("title");
        $(this).append('&lt;div class="box" id="'+dropElemId+'row2"&gt;'+dropElemTitle+' - different content here&lt;/div&gt;');
        $('div.box a').click(function(){$('#'+dropElemId+'row2').remove()});
      }
    });
  });
  </code></pre>
  
  <p>And an example of the container code looks like this:</p>
  
  <pre><code>&lt;div class="dragbox-content" style="display:block" &gt;
    &lt;div class="dragrow1"&gt;&amp;nbsp;&lt;/div&gt;
    &lt;div class="dragrow2"&gt;&amp;nbsp;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Can anyone give me any pointers?</p>
  
  <p>Thanks,</p>
  
  <p>Ali.</p>