在chrome选择滚动条中查询所有选择器(*)

时间:2013-04-15 13:50:29

标签: javascript jquery google-chrome

我有这段代码:

$("*").bind("mousedown.sg", { 'self':this }, this.sgMousedown);

它简单地绑定了页面上所有元素的事件监听器,并且它在除chrome之外的所有浏览器中都能正常工作。在Chrome监听器中绑定甚至在滚动条上,以便它停止响应点击。

问题是我可以使用哪个选择器来避免这种情况?

1 个答案:

答案 0 :(得分:1)

不确定你想要实现什么,但是绑定身体一个选项?

$("body").bind("mousedown.sg", { 'self':this }, this.sgMousedown);
相关问题