jquery上下页面视差滚动切换

2025-05-05 15:20:36

1、新建html文档。

jquery上下页面视差滚动切换jquery上下页面视差滚动切换

4、书写css代码。#bg3-1 { position: absolute; top: -111px; l髫潋啜缅eft: 355px; }#bg3-2 { position: absolute; top: 812px; left: 321px; }#bg3-3 { position: absolute; top: 1628px; left: 403px; }#bg3-4 { position: absolute; top: 2700px; left: -85px; }/* midground (clouds) */#parallax-bg2 { z-index: 2; position: fixed; left: 50%; /* align left edge with center of viewport */ top: 0; width: 1200px; margin-left: -600px; /* move left by half element's width */ }#bg2-1 { position: absolute; top: 162px; left: 200px; }#bg2-2 { position: absolute; top: 300px; left: 1150px; }#bg2-3 { position: absolute; top: 543px; left: -35px; }#bg2-4 { position: absolute; top: 1180px; left: 250px; }#bg2-5 { position: absolute; top: 900px; left: 890px; }/* background (clouds) */#parallax-bg1 { z-index: 1; position: fixed; left: 50%; /* align left edge with center of viewport */ top: 0; width: 1200px; margin-left: -600px; /* move left by half element's width */ }#bg1-1 { position: absolute; top: 85px; left: -270px; }#bg1-2 { position: absolute; top: 440px; left: 795px; }#bg1-3 { position: absolute; top: 900px; left: -220px; }#bg1-4 { position: absolute; top: 1020px; left: 450px; }

jquery上下页面视差滚动切换

6、代码整体结构。

jquery上下页面视差滚动切换
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢