0

我有两个容器。最底部的一个创建了一个滚动条,因为它的高度足够需要它。当最顶部的容器在最底部的容器 id 上方可见时,例如滚动条,适用于该容器。现在滚动影响底部和顶部容器。你怎么做呢?谢谢!

这是正在发生的事情的代码:http: //jsfiddle.net/5wNDX/68/

CSS:

#outer {
background-color: rgba(255, 255, 255, 0);
bottom: 0px;
color: rgb(51, 51, 51);
display: block;
font-size: 14px;
height: 563px;
left: 0px;
overflow-x: auto;
overflow-y: scroll;
position: fixed;
right: 0px;
top: 0px;
width: 1479px;
z-index: 9999;
}

#inner {
background-color: rgb(255, 255, 255);
border:4px solid #000;
color: rgb(51, 51, 51);
display: block;
font-size: 14px;
height: 900px;
margin:0 auto;
overflow-x: hidden;
overflow-y: hidden;
position: static;
width: 750px;
z-index: auto;
}

HTML:

<body> 
    <div>Large block of text</div>
    <div id='outer'>   
      <div id='inner'>
        test
      </div>   
    </div>
  </body>
4

1 回答 1

0

你可能需要给position: absolute你的#innerdiv 来完成这个。

于 2013-02-08T23:18:54.053 回答