我不明白为什么单击过滤器时图像会消失。
流沙脚本代码(位于名为 的文件中jquery.custom.js
):
jQuery.noConflict();
jQuery(document).ready(function($){
// Clone applications to get a second collection
var $data = $("#portfolio-items").clone();
//NOTE: Only filter on the main portfolio page, not on the subcategory pages
$('#portfolio-terms ul li').click(function(e) {
$("ul 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];
filterClass = filterClass ? filterClass.split(' ').slice(-1)[0] : '';
if (filterClass == '.all current') {
var $filteredData = $data.find('#portfolio-');
} else {
var $filteredData = $data.find('#portfolio-[data-type=' + filterClass + ']');
}
$("#portfolio-items").quicksand($filteredData, {
duration: 800,
easing: 'swing',
});
$(this).addClass("active");
return false;
});
});
在这里您可以看到投资组合项目和术语的 PHP 代码:http : //snipt.org/Mnp8
你能帮我吗?
谢谢!