I have a HTML div which as use as a canvas that contains many objects.
In this canvas, the user can draw a rectangle with the mouse to select the objects. There is a flaw in my implementation: if the canvas is too large and scroll-bar appear, dragging the scrollbars also draws a selection rectangle.
What would be a good approach to discriminate mouse down on the scroll-bar, and mouse-down anywhere else on the component ?
Edit: I’m not asking how to remove the scrollbars. I want them when they are needed
Edit: Here is a minimal fiddle to reproduce the issue I’m working on: http://jsfiddle.net/jUe8T/
THe fiddle was very helpfull as i though you were using the
<canvas>element… i think this is what you want: http://jsfiddle.net/jUe8T/1/i did this by adding a
.scrollevent to$('#canvas')withupHandleras handler, like this: