【发布时间】:2014-11-17 19:24:50
【问题描述】:
我已经成功地让航点 (http://imakewebthings.com/jquery-waypoints/) 和水平滚动 (http://www.htmldrive.net/items/show/966/jQuery-Horizontal-automatic-Scrollbars-with-mouse) 在单独的页面上工作,但无法将它们组合起来。我认为这与航点选项参数有关。
航点功能是:
$(function () {
$('#waypoint').waypoint(function () {
alert('You have scrolled to an entry.');
}, {
offset: '100px'
});
});
它被添加到页面中:
<div id="horiz_container_outer">
<div id="horiz_container_inner">
<div id="horiz_container">
<div class="horiz_box1">Stuff</div>
<div class="horiz_box2">Stuff</div>
<div class="horiz_box1">Stuff2</div>
<div class="horiz_box2">Stuff2</div>
<div class="horiz_box1">Stuff3</div>
<div class="horiz_box2">Stuff3</div>
<div id="waypoint">Waypoint</div>
</div>
</div>
我整理了一个快速的 JS 小提琴,但由于某种原因,该示例中的水平滑块无法正常工作。如果有帮助:http://jsfiddle.net/bretwhiteley/w2p84Lmp/
【问题讨论】:
-
我确实注意到我需要将水平滚动设置为 true: "horizontal:true," - 这没什么区别
标签: javascript jquery scroll jquery-waypoints