I don't want my web page to scroll. I have a <body>
of width 100%, I set its overflow
to hidden
, and it generally works. No scroll bars, no mousewheel / touchpad gestures scroll. But if I click and drag just anywhere, I can still scroll.
The stinker is that I have a div absolutely positioned so it's sticking outside of its parent, partially (and sometimes entirely) off screen. For a handful of reasons, I can't get around that right now.
This fiddle illustrates my problem (I am seeing it in webkit), http://jsfiddle.net/ax5x7/2/
Dragging pretty much anywhere off to the right in the HTML will cause the page to slide along. It's tricky to go back because there are no scroll bars, so if you do this by mistake, it looks bad.
Poking around here found one suggestion related to jQuery's deprecated disableSelection()
, but unless I'm doing it wrong (I applied it to body as well as all the children) it doesn't seem to prevent the behaviour. I also found a question a couple of years old that didn't seem to have a satisfactory solution. The bandaid is a bit kludgy, I'd rather not scroll to (0,0) on an interval.