Limit items or paginate in Quicksand

喜夏-厌秋 提交于 2019-12-21 21:46:44

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!