2013-06-18 18 views

回答

1

UPDATE DEMO http://jsfiddle.net/yeyene/7fEQs/7/

JQUERY

$(function() { 
    $("#sortable").sortable({ 
     revert: true, 
     receive: function(event, ui) { 
      $(this).find('div').removeClass('ui-state-highlight ui-draggable').css({'display':''});    

      var html = []; 
      $(this).find('div').each(function() { 
       html.push('<li class="ui-state-default">' + $(this).text() + '</li>'); 
      }); 
      $(this).find('div').replaceWith(html.join('')); 
     } 
    }); 
    $("#draggable").draggable({ 
     connectToSortable: "#sortable", 
     helper: "clone", 
     revert: "invalid" 
    }); 
    $("ul, li").disableSelection(); 
}); 
+0

幹得好!!!引用鏈接不updated.pls改變它.. – Gopesh

+0

謝謝,已經改變了,http://jsfiddle.net/yeyene/7fEQs/7/ – yeyene

+0

非常感謝你:) –