问题
I'm using the Quicksand jQuery plugin. It works fine, but now I want to limit the initial items, for example only show 20 or 30 items. How can I do this?
My current code:
Shadowbox.init({
skipSetup: true
});
$(document).ready(function () {
var $filterType = $('#boxAreas li.active a').attr('class');
var $holder = $('ul#elportafolio');
var $data = $holder.clone();
$('#boxAreas li a').click(function (e) {
$('#boxAreas li').removeClass('active');
var $filterType = $(this).attr('class');
$(this).parent().addClass('active');
if($filterType == 'all') {
var $filteredData = $data.find('li');
} else {
var $filteredData = $data.find('li[data-type=' + $filterType + ']');
}
$holder.quicksand($filteredData, {
duration: 1000
}, function () {
Shadowbox.setup("li.thumb_porta a", {});
});
return false;
});
});
来源:https://stackoverflow.com/questions/8264705/limit-items-or-paginate-in-quicksand