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?
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.
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With