$(".m-redpackets-pool-item-click").click(function(thiss) { var thiss = $(this); //获取当前元素 }); $("#m-redpackets-pool-item-open").click(function(thiss) { thiss.hide(); //将获取的元素隐藏 //为什么报错thiss is not a function });
1 回答
凤凰求蛊
TA贡献1825条经验 获得超4个赞
没有见过.click()的handle带参数的。
我猜你大概是想这么写:
var thiss;
$(".m-redpackets-pool-item-click").click(function() {
thiss = $(this); //获取当前元素
});
$("#m-redpackets-pool-item-open").click(function() { if(thiss)
thiss.hide();
});添加回答
举报
0/150
提交
取消
