开发者

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

开发者 https://www.devze.com 2023-02-13 06:44 出处:网络
please take a look at this fiddle: http://jsfiddle.net/T6Hhy/1/ What I have h开发者_StackOverflowere is a rightcol that is position:fixed. The issue I\'m having is that items are scrolling off the

please take a look at this fiddle:

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

What I have h开发者_StackOverflowere 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


use the following css property:

overflow:auto;


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;
}


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消