Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide the scrollbar but keep the ability to scroll with native feel

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.

like image 658
Gabriele Cirulli Avatar asked Jul 09 '11 15:07

Gabriele Cirulli


2 Answers

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.

like image 82
NGLN Avatar answered Sep 24 '22 21:09

NGLN


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;
}
like image 38
Joonas Avatar answered Sep 24 '22 21:09

Joonas