AnApprentice
AnApprentice

Reputation: 110960

Given a fixed position Element, How to show a scrollbar when the item scrolls off the page

please take a look at this fiddle:

http://jsfiddle.net/T6Hhy/1/

What I have here is a rightcol that is position:fixed. The issue I'm having is that items are scrolling off the page, but the scroll bar is not appear.

How can I have a fixed position column, as I don't want the column to scroll when a user scrolls the page, but have the column have a scrollbar if items are scrolling off the page?

Thanks

Upvotes: 0

Views: 1800

Answers (3)

Sotiris
Sotiris

Reputation: 40066

overflow-y: auto; for #wrapper #rightCol will do the job.

Demo: http://jsfiddle.net/T6Hhy/2/

The user scroll the element which has the cursor above it.

Upvotes: 0

TNC
TNC

Reputation: 5386

If I understood your question, you can do something like this:

#wrapper #rightCol {
    top: 10px;
    right: 20px;
    left: auto;
    z-index: 10;
    position: fixed;
    width: 245px;
    max-width: 245px;
    background: Red;
    bottom: 0px;
    overflow: auto;
}

Upvotes: 0

Jonathan Fingland
Jonathan Fingland

Reputation: 57167

use the following css property:

overflow:auto;

Upvotes: 1

Related Questions