簡體   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