我使用航點(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")
}
被稱爲「但錯誤不會消失。我如何將回調函數或處理程序選項集成到我的函數中?