Javascript 更改滚动条上的div位置

Javascript 更改滚动条上的div位置,javascript,jquery,css,html,parallax,Javascript,Jquery,Css,Html,Parallax,您好,我有4个部分,最初我设置了第一个div的位置并进行了固定 重置div绝对位置这是我的代码: <section id="intro" class="main style1 dark full screen" style="position: fixed; top: 0px; height: 677px;"> <div class="content container small"> something goes here </div> </

您好,我有4个部分,最初我设置了第一个div的位置并进行了固定 重置div绝对位置这是我的代码:

<section id="intro" class="main style1 dark full screen" style="position: fixed; top: 0px; height: 677px;">
<div class="content container small">
     something goes here
</div>
</section>
<section id="one" class="main style2 right dark fullscreen" style="position: absolute; top: 4000px; height: 677px;">
<div class="content box style2">
     Something goes here
</div>
</section>
<section id="two" class="main style2 left dark fullscreen" style="position: absolute; top: 6700px;">
<div class="content box style2">
     Something goes here
</div>
</section>
<section id="work" class="main style3 primary" style="position: absolute; top: 7184px;">
<div class="content container">
     Something goes here
</div>
</section>
<section id="contact" class="main style3 secondary" style="position: absolute; top: 10184px;">
<div class="content container">
     Something goes here
</div>
</section>
实际上,我想当我滚动我的页面时,第二部分到达顶部:0位置应该是固定的,其余部分的位置应该是绝对的。实际上,我正在创建视差滚动效果

提前谢谢


这是我的

你能制作JSFIDLE.net吗?这是我在滚动时应该固定哪个部分?我没有得到你想要的确切信息。我希望哪个部分达到顶部0,应该固定位置