我正在用waypoints.js和skrollr.js写一个视差网站 并遇到了一个问题:
slide1应滚动正常(垂直),而slide-2应在触发后滚动水平(宽度:4000px)。但我不知道该怎么做。我知道新的waypoints.js有水平:true但我现在有点卡住了。有人有想法吗?
<section id="slide-1">
<div data-anchor-target="#slide-1">
<div class="Container">
<div class="Content">
<h2>Scroll this vertically</h2>
</div>
</div>
</div>
</section>
<section id="slide-2">
<div data-anchor-target="#slide-2">
<div class="Container">
<div class="Content">
<h2>Scroll this horizontal</h2>
</div>
</div>
</div>
</section>
<section id="slide-3">
<div data-anchor-target="#slide-3">
<div class="Container">
<div class="Content">
<h2>Scroll this vertically again</h2>
</div>
</div>
</div>
</section>
可能是这样的:
$('#slide-2').waypoint(function() {
//toogle #slide-2 width:4000px scroll horizontal:true etc.
;});