这是我的简单jQuery代码,用于隐藏/显示动态元素
$('.network').click(function() {
if($("a[data-network='all']").hasClass('active')) {
if($(this).data("network") !== "all") {
var network = $(this).data('network');
switch(network) {
case "fb":
$(".facebook").hide("slide", { direction: "up" }, 2000);
break;
case "tw":
break;
case "all":
break;
}
}
}
});
运行click()
函数时,它将Uncaught TypeError: Property '#<Object>' of object #<Object> is not a function
推送到console.log
错误来自此行
$(".facebook").hide("slide", { direction: "up" }, 2000);