繁体   English   中英

使固定边栏中的内容可滚动

[英]Make content inside fixed sidebar scrollable

我做了这个js小提琴: http : //jsfiddle.net/VaCfV/3/

它具有较长的内容,并且内部有固定的侧边栏。 我试图弄清楚如何使侧边栏#side-content可滚动不是通过使用overflow-y: scrollable; 但实际上是在用户使用鼠标滚轮,箭头键,主滚动条等时与页面一起滚动。

能以某种方式实现吗?

你可以试试:

#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/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM