我想在我的網站上包含流沙腳本,但是我失敗了。
螢火蟲給我這個錯誤:65 Uncaught TypeError: Cannot call method 'split' of undefined
:
未捕獲TypeError:無法調用未定義的方法'split'
這個腳本:
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;
});
});
在這裏看到:http://stakk.it/
什麼錯誤?
謝謝你,對不起我的英文不好!
你爲什麼會認爲filterClass可能可能等於'。所有current'? – Neil