我使用jQuery Isotope填充多宽多高网格(等比例)上的空格。
使用ui-sortable对栅格进行排序,并在排序后使用按钮切换回Isotope。有些排序顺序会留下空块。如何使用Isotope填充空格?
我已经尝试了多种同位素布局方法。
请参阅http://jsfiddle.net/zdSYG/41/
$(document).ready(function() {
var $itemList = $('#sortable');
$itemList.isotope({
resizesContainer: false,
masonry: {
rowHeight: 250,
columnWidth: 325
}
});
$('#wp-admin-bar-edit').click(function() {
$itemList.isotope('destroy');
$itemList.sortable({
//Do Ajax Stuff with UI-Sort Order
});
});
});
//Toggle back to Isotope after jQuery UI-Sortable Ajax stuff
$(document).ready(function() {
$('#wp-admin-bar-sort').click(function() {
$('#sortable').isotope({
resizesContainer: false,
masonry: {
rowHeight: 250,
columnWidth: 325
}
});
});
});Udate:
想要的效果在Firefox4、IE8和IE9中都能达到,但问题似乎出在Google Chrome (最新版本的稳定通道)上。
Chrome:

Firefox 4:

发布于 2012-04-01 17:54:55
我发现它是在我使用jquery的早期版本时,在我的例子中是1.4.1。我迁移到了1.7.1,现在一切都很好。
https://stackoverflow.com/questions/6233270
复制相似问题