3
我正在使用同位素砌體(版本2 Beta 7)嘗試對未排序的項目1至8進行排序。同位素砌體自動佈局覆蓋sortby?
誰有優先級砌體自動佈局或getSortData選項?
我有4列和2行未排序:
1 2 3 4
5 8 7 6
但我想是這樣的:
1 2 3 4
5 6 7 8
我正在使用的代碼如下:
<div id="container" class='isotope'>
<div class='item'>
<img src="http://placehold.it/185x92" width="185" height="92" alt="">
<div>
<span class='titulo'>H</span>
<span class='orden'>1</span>
</div>
</div>
...
</div>
$(function(){
var $container = $('#container');
$container.isotope({
itemSelector: '.item',
masonry: {
columnWidth: 185,
gutter: 10,
isFitWidth: true,
},
getSortData : {
numero : '.orden parseInt',
titulo : '.titulo'
},
sortBy : 'numero',
});
});
完整的代碼在Fiddle
非常感謝。