【发布时间】:2017-08-24 23:31:39
【问题描述】:
我有许多 DIV,我将它们放在另一个之上。
我想要做到的是能够滚动顶部的 DIV,然后在 DIV 的底部,显示下面的 DIV。
到目前为止,这是我必须要做的:
https://codepen.io/dadofgage/pen/yMqZaj
<style>
#container {
position: relative;
}
.overlay, .overlay2, .overlay3,
.content{
display:block;
position: absolute;
top: 0;
left: 0;
}
.overlay3{
z-index: 8;
background: #000;
color:#fff
}
.overlay2{
z-index: 9;
background: #c00;
}
.overlay{
z-index: 10;
background: #ccc;
}
</style>
<div id="container">
<div class="overlay3">This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. This is the top div of content. </div>
<div class="overlay2">This is the SECOND div of content. This is the SECOND div of content. This is the SECOND div of content. This is the SECOND div of content. This is the SECOND div of content. This is the SECOND div of content. This is the SECOND div of content. This is the SECOND div of content. This is the SECOND div of content. This is the SECOND div of content. This is the SECOND div of content. This is the SECOND div of content. This is the SECOND div of content. This is the SECOND div of content. This is the SECOND div of content. This is the SECOND div of content. This is the SECOND div of content. This is the SECOND div of content. This is the SECOND div of content. This is the SECOND div of content. </div>
<div class="overlay">This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. This is the THIRD div of content. </div>
<div class="content">This is the BOTTOM div of content. This is the BOTTOM div of content. This is the BOTTOM div of content. This is the BOTTOM div of content. This is the BOTTOM div of content. This is the BOTTOM div of content. This is the BOTTOM div of content. This is the BOTTOM div of content. This is the BOTTOM div of content. This is the BOTTOM div of content. This is the BOTTOM div of content. This is the BOTTOM div of content. This is the BOTTOM div of content. This is the BOTTOM div of content. This is the BOTTOM div of content. This is the BOTTOM div of content. This is the BOTTOM div of content. This is the BOTTOM div of content. This is the BOTTOM div of content. </div>
【问题讨论】:
-
您需要在此处显示显示问题的代码的最小示例,而不是明天可能会消失的第三方网站。向我们展示 jQuery。
-
我没有任何其他代码 - 这就是我想要弄清楚的
-
@Mike 你试过什么?这只是 CSS 和 HTML。你的 JavaScript 或 jQuery 在哪里?
标签: jquery html css scroll effect