每当waypoint('sticky')
更改导航栏的类时,我想切换另一个元素的类。我试图使用handler
选项触发回调,但它不起作用。我该怎么办?
答案 0 :(得分:6)
Waypoints的回调选项出于某种原因是“处理程序”,所以你可以这样做:
$.waypoint('sticky', {
handler: function(dir) {
//Do stuff when the user scrolls past this waypoint.
}
});