I want to be able to scroll through the whole page, but without the scrollbar being shown.
In Google Chrome it's:
::-webkit-scrollbar {
display: none;
}
But Mozilla Firefox and Internet Explorer don't seem to work like that.
I also tried this in CSS:
overflow: hidden;
That does hide the scrollbar, but I can't scroll anymore.
Is there any way I can remove the scrollbar while still being able to scroll the whole page? With just CSS or HTML, please.
HTML:
CSS:
Apply CSS accordingly.
Check it here (tested in IE and FF).
This works for me:
Note: In the latest versions of Firefox the
-moz-scrollbars-none
property is deprecated ( link ).Another sort of hacky approach is to do
overflow-y: hidden
and then manually scroll the element with something like this:There's a great article about how to detect and deal with
onmousewheel
events in deepmikoto's blog. This might work for you, but it is definitively not an elegant solution.Not sure if I'm too late to the party but adding
worked for me
This is a divitis-esque solution which nontheless should work for all browsers...
The markup is as follows, and needs to be inside something with relative positioning (and its width should be set, for example 400px):
The CSS:
perfect-scrollbar
plugin seems to be the way to go, see: https://github.com/noraesae/perfect-scrollbarIt is well documented and complete JS based solution for the scrollbars issue.
Demo page: http://noraesae.github.io/perfect-scrollbar/