I have a scrolling div with overflow:auto
And I want to scroll it by changing scrollTop, but before changing it I want to find out if the user is “holding” the scrollbar with his cursor, how do I do that?
I have a scrolling div with overflow:auto And I want to scroll it by
Share
You could bind your div to an event handler and then use a global variable.
That way you could test to see if the mouse is being pressed down on the div. I’m not sure there’s a way to handle mousedown on a generic scrollbar but if you needed to bind the events to the scrollbar I’d use a jquery scrollbar pluging or make my own.