2011-02-28 102 views

回答

1

我想我有類似的問題。

我試圖通過簡單地回憶建立可排序元素的代碼中的砌體來解決它。 (有可能是一個更好的辦法,我不知道?)

$(function() { 
     $("#youritem").sortable({ opacity: 0.9, cursor: 'move', update: function() { 
      var order = $(this).sortable("serialize") + '&action=updateRecordsListings'; 
      $.post("dosomething.php", order, function(theResponse){ 
         //you can see that i've re-called masonry once the sortable object has been moved     
         $('#youritem').masonry({columnWidth: 200, itemSelector: 'youritem' }); 
      });                
     }         
     }); 
    }); 

希望這可以幫助你 - 如果有另一種方式,我也想知道。

1

使用gridster - 它就像一個魅力非常直觀

enter image description here

+0

與gridster唯一的問題是,據我所知,它只是改變了順序視覺。如果你想重新排列DOM中的項目,你會想使用Sortable和Masonry。 – Cpage 2012-12-07 21:17:12