如果鼠标在固定块上方,则滚动不起作用
Scroll don't work, if mouse above fixed block
我有问题。如果我的鼠标位于该块上方,则页面上的固定块会阻止滚动。
我的例子:
body {
overflow: hidden;
padding: 0;
margin: 0;
}
.body_block {
display:block;
position: absolute;
width: 100%;
height: 100%;
background-color: #e0e0e0;
overflow: hidden;
}
.menu {
display: block;
width: 100px;
height: 200px;
background-color: #ffdd56;
position: fixed;
top: 0;
right: 0;
z-index: 3;
}
.content {
display: block;
position: relative;
top: 0;
left: 0;
background-color: #a9eceb;
width: 100%;
height: 100%;
z-index: 2;
overflow: scroll;
}
这是工作 fiddle:http://jsfiddle.net/u6b42vsq/4/
这是最后的 css:
body {
padding: 0;
margin: 0;
}
.body_block {
display:block;
position: absolute;
width: 100%;
background-color: #e0e0e0;
overflow: hidden;
}
.menu {
display: block;
width: 100px;
height: 200px;
background-color: #ffdd56;
position: fixed;
top: 0;
right: 0;
z-index: 3;
}
.content {
display: block;
position: relative;
top: 0;
left: 0;
background-color: #a9eceb;
width: 100%;
height: 100%;
z-index: 2;
}
我有问题。如果我的鼠标位于该块上方,则页面上的固定块会阻止滚动。 我的例子:
body {
overflow: hidden;
padding: 0;
margin: 0;
}
.body_block {
display:block;
position: absolute;
width: 100%;
height: 100%;
background-color: #e0e0e0;
overflow: hidden;
}
.menu {
display: block;
width: 100px;
height: 200px;
background-color: #ffdd56;
position: fixed;
top: 0;
right: 0;
z-index: 3;
}
.content {
display: block;
position: relative;
top: 0;
left: 0;
background-color: #a9eceb;
width: 100%;
height: 100%;
z-index: 2;
overflow: scroll;
}
这是工作 fiddle:http://jsfiddle.net/u6b42vsq/4/ 这是最后的 css:
body {
padding: 0;
margin: 0;
}
.body_block {
display:block;
position: absolute;
width: 100%;
background-color: #e0e0e0;
overflow: hidden;
}
.menu {
display: block;
width: 100px;
height: 200px;
background-color: #ffdd56;
position: fixed;
top: 0;
right: 0;
z-index: 3;
}
.content {
display: block;
position: relative;
top: 0;
left: 0;
background-color: #a9eceb;
width: 100%;
height: 100%;
z-index: 2;
}