Html
    Css
    Js

    
                        
 body {
	padding:0;
	margin:0;
}
section {
	height:100vh;
}
.bg-word {
	background:#ccc;
	text-align:center;
	font-size:56px;
}
.bg-img:nth-child(2) {
	background-image:url('http://www.jq22.com/img/cs/500x500-1.png');
	background-attachment:fixed;
	background-size:cover;
	background-position:center center;
}
.bg-img:nth-child(4) {
	background-image:url('http://www.jq22.com/img/cs/500x500-2.png');
	background-attachment:fixed;
	background-size:cover;
	background-position:center center;
}
.bg-img:nth-child(6) {
	background-image:url('http://www.jq22.com/img/cs/500x500-3.png');
	background-attachment:fixed;
	background-size:cover;
	background-position:center center;
}

                        
↑上面代码改变,会自动显示代码结果 jQuery调用版本:1.11.3
 立即下载

纯CSS实现视差滚动

0