Reputation: 381
I want to toggle a class of another element whenever waypoint('sticky')
changes the class of the navigation bar. I was trying to fire a callback using the handler
option, but it does not work. What could I do?
Upvotes: 5
Views: 2481
Reputation: 503
The callback option for Waypoints is, for some reason, "handler", so you could do it like this:
$.waypoint('sticky', {
handler: function(dir) {
//Do stuff when the user scrolls past this waypoint.
}
});
Upvotes: 6