6

I've searched for an answer to this question and came across hide scrollbar while still able to scroll with mouse/keyboard but the jQuery plugin doesn't quite do what I'd like to do. For one, the scrolling feels a bit sloppy and uncontrollable. The reason why I need this is simple: my page gets a little longer when you expand some items and the scrollbar appears out of the side and makes everything move to the left. I'd like to have a way to avoid this, by either being able to keep the scrollbar visible at all times or hiding it completely but still keep the native ability to scroll.

Here's an example of what I mean: http://screencast.com/t/Roi3HJtHyH when the long entry is clicked the content moves to the left, and this effect looks a little ugly.

Community
  • 1
  • 1
kettlepot
  • 10,574
  • 28
  • 71
  • 100

4 Answers4

13

Just for completeness sake, to answer your question, here is the scrollable page without scrollbar.

Note that this is not preferred, and I would also force the scrollbar as Lobello already answered.

NGLN
  • 43,011
  • 8
  • 105
  • 200
  • That by the way doesnt seem to work with touch devices. At least ipads Safari mobile says no to that. – Joonas Jul 09 '11 at 17:16
  • @Lobello Hmm, interesting. Another reason not to use it. – NGLN Jul 09 '11 at 17:17
  • @NGLN: Try your demo in Chrome/Safari: highlight/select a line and drag your mouse to the right and you'll see the scrollbar. Or use a textarea instead of the inner element and then fill it with some text. Then use the keyboard keys `Page Up` and `Page Down`. – Mori Dec 06 '12 at 16:41
1

That is standard browser behavior.

Taking away scrollbar reduces user-friendliness.


You can set scrollbar to stay visible all the time with css.

CSS:

body {
    overflow-y: scroll;
}
Joonas
  • 7,227
  • 9
  • 40
  • 65
0

If you really want to disable the scrolling (In a frameset, the worst possible place for scrolling) then use scrolling=no.

Eman yalpsid
  • 511
  • 1
  • 5
  • 8
-1

This works for me:

    body{
        overflow:hidden;
    }
taptone
  • 1
  • 5