我使用航点(http://imakewebthings.com/jquery-waypoints/#shortcuts-examples)和绿色环(http://www.greensock.com/)来触发某些元素在用户处于不同级别的页面页面时的移动。如何实现回调函数或处理程序选项
$(".three").waypoint(mover($(".four"), 1, 32, 32));
然而,JavaScript控制台不断给我这个消息(尽管一切工作完美,视觉)
Uncaught Error: jQuery Waypoints needs a callback function or handler option. jquery.js:4
x.extend.error jquery.js:4
$.fn.(anonymous function) waypoints.js:360
(anonymous function) scroll.js:15
c jquery.js:4
p.fireWith jquery.js:4
x.extend.ready jquery.js:4
q
我试图返回“真:
function mover(speed, targetx, targety) {
TweenMax.to($(".four"), speed, {x:targetx, y:targety});
console.log("waypoint reached");
alert("Down")
}
被称为“但错误不会消失。我如何将回调函数或处理程序选项集成到我的函数中?