【发布时间】:2015-07-18 16:14:20
【问题描述】:
您好,我在我的文档中使用 JavaScript 插件作为航点。我遇到的问题是,当我有一个 Waypoint 时,它可以工作并运行正确的功能,但是一旦我放置另一个 Waypoint,它们都不起作用。
下面是工作的
var waypoint = new Waypoint({
element: document.getElementById('waypoint'),
handler: function(direction){
start();
waypoint.destroy()
}
});
当我像下面这样添加第二个时,它们都不起作用,我不知道为什么
var waypoint2 = new Waypoint({
element: document.getElementById('waypoint2'),
handler: function(direction){
alert('hello');
waypoint2.destroy()
}
});
var waypoint = new Waypoint({
element: document.getElementById('waypoint'),
handler: function(direction){
start();
waypoint.destroy()
}
});
有什么想法吗?谢谢,基兰
【问题讨论】:
标签: javascript jquery jquery-waypoints