【发布时间】:2011-10-05 00:54:29
【问题描述】:
如何检测用户是否点击了同一个 div?
我试过这个没有成功:
_oldthis = null;
var _this = $(this);
if(_oldthis == _this) {
alert('You clicked this last');
}
_oldthis = _this;
【问题讨论】:
-
你声明了_oldthis
-
我认为您需要提供更多上下文... oyu 是否需要存储点击历史并在某处进行比较?如果是这样,出于什么原因?此外,如果您可以 psot 完整的点击处理程序而不是 jsut 其代码的摘录,这将是有用的:-)
标签: jquery jquery-selectors this