當光標位於頂部的藍色塊上時無法滾動,關於我要去哪裏的錯誤的任何想法?無法在頂部div中滾動
HTML
<div class="wrapper">
<div class="block">
block
</div>
<div class="content">
content
</div>
</div>
CSS
body {
margin: 0px;
padding: 0px;
}
.block {
background: blue;
height: 300px;
width: 100%;
position: fixed;
}
.content {
background: red;
margin-top: 300px;
top: 0;
width: 100%;
height: 100%;
z-index: 100;
position: absolute;
}
.wrapper {
position: absolute;
width: 100%;
height: 100%;
overflow: auto;
}
JS
$(".wrapper").scrollTop(300);
我需要的塊是固定的,是有任何其他方式嗎? – Rob
檢查鏈接http://jsfiddle.net/cr8uj/8/它的不固定 –