Question

I am just wondering if there is any solution for a scrollable area (ie overflow: scroll) with the scrollbar hidden? I didn't find a solution while googling it so i ask here. It would be cool if this is possible with CSS. But if there is a solution with JS or php I'd still like to know.

Was it helpful?

Solution

By absolute positioning a container in an outer container that is relative positioned with hidden overflow you can hide the scrollbar of the inner container outside of the first.

So the scrollbar is still there, but you won't be able to see it.

    #outer {
        position: relative;
        width: 200px;
        height: 300px;
        padding: 0;
        margin: 0;
        overflow: hidden;
    }
    #inner {
        position: absolute;
        left: 0;
        top: 0;
        right: -30px;
        bottom: 0;  
        padding-right: 15px;
        overflow-y: scroll;
    }

JSFiddle: http://jsfiddle.net/g6URf/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top