Hidden scrollbars in Firefox (allows scrolling but just no scrollbar)

Matt picture Matt · Apr 28, 2011 · Viewed 87.2k times · Source

I'd like to create a div that is able to scroll but does not display scrollbars. I have found a solution for Webkit (below) but how can this be done in other browsers?

I'd prefer to avoid using a javascript plugin. Hoping to find a CSS or vendor specific solution.


Webkit Solution

#photoreel::-webkit-scrollbar {
    height: 0;
    width: 0;
}
#photoreel {
    overflow-x: scroll;
    overflow-y: hidden;
}

Answer

user123444555621 picture user123444555621 · Apr 28, 2011

You must wrap your scrollable div in another div with overflow:hidden that hides the scrollbar.

See http://jsfiddle.net/qqPcb/ for an example.

BTW: The same technique is used by a nice little jQuery plugin called jScrollPane