Tôi đang cố gắng đưa vào trang web của tôi tập lệnh Quicksand, nhưng tôi không thành công.
Firebug mang lại cho tôi lỗi này: 65 Uncaught TypeError: Cannot call method 'split' of undefined
:
Loại không bắt buộcLỗi: Không thể gọi phương thức 'tách' không xác định
cho kịch bản này:
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];
jquery.custom.js:65 Uncaught TypeError: Cannot call method 'split' of undefined (repeated 6 times)
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;
});
});
Xem ở đây: http://stakk.it/
lỗi là gì?
cảm ơn và xin lỗi vì tiếng anh xấu của tôi!
Tại sao bạn sẽ nghĩ rằng filterClass thể có thể bình đẳng '.Tất cả current'? – Neil