Any suggestions for how to listen for mousedown on $(document) except a div’s overflow:scroll scrollbar?
I am not sure what element the scrollbar is in order to refer to it…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can check the target yourself with :
FIDDLE
The scrollbar is’nt really an element, and click handlers won’t work, but it seems mousedown is fired, but will just give you the element the scrollbar belongs to.
To exclude just the scrollbar I’m guessing you will have to figure out it’s size, and then check the mouse position on mousedown to see if it’s within the scrollbar area.