这是jfiddle http://jsfiddle.net/pq5ckkcg/4/。无论鼠标在哪里,我基本上都需要整个窗口和div一起滚动。我该如何做到这一点?
<div id="bottomwrap">
<div id="element"></div>
<div id="element"></div>
<div id="element"></div>
</div>
#bottomwrap {
position:fixed;
top:45px;
right:0;
width:80%;
overflow-y:scroll;
bottom:0;
background-color:#666;
}
#element {
float:left;
width:200px;
height:300px;
background-color:#000;
margin:20px;
}
答案 0 :(得分:0)
您的父div需要相对定位:
#bottomwrap {
position:relative;
margin-top:45px;
float: right;
width:80%;
overflow-y:scroll;
bottom:0;
background-color:#666;
}