I am currently using waypoints.js to manage a single-page website that includes a highlighted navigation feature. When the viewport reaches the element with the class "content", the corresponding navigation point is given the class "active". The script is functioning correctly at this point. However, my goal is to remove the class "active" from the navigation point (specifically .content-nav-point
) when the .content
element is no longer in the viewport.
$('.content').waypoint(function() {
$( '.content-nav-point' ).toggleClass('active');
}, { offset: '0%' });