每件事都按我想要的方式工作,唯一的问题是,当您单击过滤器(一张床/两张床)时它不会缩放,它只会褪色。原始的 quciksand 示例在过滤器之间渐变和缩放
这是我的示例 http://theoaks.turnpostadmin.com/floor-plans/
我的代码
// jQuery Quicksand project categories filtering
jQuery.noConflict();
jQuery(document).ready(function($){
// Clone applications to get a second collection
var $data = $(".portfolio-content").clone();
//NOTE: Only filter on the main portfolio page, not on the subcategory pages
$('.portfolio-main li').click(function(e) {
$(".filter li").removeClass("active");
// Use the last category class as the category to filter by. This means that multiple categories are not supported (yet)
var filterClass=$(this).attr('class').split(' ').slice(-1)[0];
if (filterClass == 'all-projects') {
var $filteredData = $data.find('.project');
} else {
var $filteredData = $data.find('.project[data-type=' + filterClass + ']');
}
$(".portfolio-content").quicksand($filteredData, {
duration: 750,
easing: 'swing',
attribute: 'data-id', // attribute to recognize same items within source and dest
adjustHeight: 'auto', // 'dynamic' animates height during shuffling (slow), 'auto' adjusts it before or after the animation, false leaves height constant
useScaling: true, // disable it if you're not using scaling effect or want to improve performance
enhancement: function(c) {}, // Visual enhacement (eg. font replacement) function for cloned elements
selector: '> *',
dx: 0,
dy: 0
}, function() {
});
$(this).addClass("active");
return false;
});
});