<script src="./js/jquery.js"></script>
<script src="./js/jquery.stellar.js"></script>
<div class="content" id="content1" data-stellar-background-ratio="0.1">
<p>第一页</p>
</div>
<div class="content" id="content2" data-stellar-background-ratio="0.1">
<p>第二页</p>
</div>
<div class="content" id="content3" data-stellar-background-ratio="0.1">
<p>第三页</p>
</div>
<div class="content" id="content4" data-stellar-background-ratio="0.1">
<p>第四页</p>
</div>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-size: 20px;
color: white;
text-shadow: 0 1px 0 black, 0 0 5px black;
}
p {
padding: 0 0.5em;
margin: 0;
}
.content {
background-attachment: fixed;
height: 100vh;
}
#content1 {
background-image: url("images/1.jpg");
background-size: cover;
}
#content2 {
background-image: url("images/2.jpg");
background-size: cover;
}
#content3 {
background-image: url("images/3.jpg");
background-size: cover;
}
#content4 {
background-image: url("images/4.jpg");
background-size: cover;
}
</style>
<script>
// $('#someElement').stellar(); // 给元素调用方法
$.stellar(); // 默认body容器
</script>
1.33 MB, 下载次数: 138
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |