Ilja
Ilja

Reputation: 46537

Make content inside fixed sidebar scrollable

I made this js fiddle: http://jsfiddle.net/VaCfV/3/

It has some long content and a fixed positioned sidebar with content inside it. I'm trying to figure out how to make content inside sidebar #side-content scrollable Not by using overflow-y: scrollable; but actually scroll together with page when user uses mouse wheel, arrow keys, main scrollbar etc..

Can this be somehow achieved?

Upvotes: 0

Views: 321

Answers (1)

Abraham Uribe
Abraham Uribe

Reputation: 3118

you can try:

#page-wrapper{
    overflow: hidden;
    position: relative;
    width: 100%;
}
#sidebar {
    width: 30%;
    height: 100%;
    position: absolute;
    left: 20px;
    top:0px;
    bottom:0px;
    background: #fff;
    border-left: 1px solid #000;
    border-right: 1px solid #000;
    padding: 20px;
}    

http://jsfiddle.net/VaCfV/4/

Upvotes: 1

Related Questions