Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery all selector(*) in chrome select scrollbars

I have this code:

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

It simple bind event listener on all elements at the page and it work correctly in all browsers except chrome. In chrome listener bind even on the scroll bar so that it stops responding to clicks.

The question is which selector can I use to avoid this ?

like image 317
Suhan Avatar asked Mar 20 '26 17:03

Suhan


1 Answers

Not sure what you're trying to achieve, but is binding to the body an option?

$("body").bind("mousedown.sg", { 'self':this }, this.sgMousedown);
like image 128
Erik Nijland Avatar answered Mar 23 '26 06:03

Erik Nijland



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!