2011-02-28 148 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