我目前正在开发一个网站,在滚动功能方面需要类似的东西:http://www.apple.com/iphone-5s/
在提出这个问题的过程中,我上传了一部分网站 - http://www.bnacademy.com.au/
我仔细查看了网站的(苹果)代码,当然,正如我应该怀疑的那样,它是空的.我正在寻找一种可以滚动浏览全页div(带背景图像)的方法,并通过鼠标在单个向上/向下滚动上滚动到下一个div.
我已经处理了动态的整页div,我几乎甚至没有滚动功能,但它只是没有按照我的预期工作,我已经花了几天时间.
HTML:
<div class="splashPage mainDiv"></div>
<div id="containerHomes" class="mainDiv homesPosition"></div>
Run Code Online (Sandbox Code Playgroud)
CSS:
.homesPosition {
top: 100%;
}
.splashPage {
background: black;
z-index: -200;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}
#containerHomes {
z-index: -200;
width: 100%;
height: 100%;
position: absolute;
left: 0;
background:url(../img/background-placeholder.jpg) no-repeat;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
Run Code Online (Sandbox Code Playgroud)
jQuery的:
<!-- Keep the div at max page height and width -->
<script type="text/javascript">
var height = …
Run Code Online (Sandbox Code Playgroud)