You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A super duper simple waypoints library to handle the simple challenge of having a submenu of anchor links with ID-based href's (i.e. #Intro) that need to initiate a scroll animation to the corresponding DOM Element. See the submenu on Wanderlust 108s for an example of what I am talking about.
Dependencies
This example uses the RAFScroll library to replace window.addEventListener('scroll', function(e) {.. native usage. Replace if you want a simple but less performant option. We also use the Velocity animation library to fade in the video. Again, replace this with another form of animation if you need!
Notes
The module will toggle an is-fixed class to the submenu when it has reached the top of the page.
The module will add an is-active class to an anchor element when the user has scrolled to it's corresponding DOM Node
A super duper simple waypoints library to handle the simple challenge of having a submenu of anchor links with ID-based href's (i.e. #Intro) that need to initiate a scroll animation to the corresponding DOM Element. See the submenu on Wanderlust 108s for an example of what I am talking about.
Dependencies
This example uses the RAFScroll library to replace window.addEventListener('scroll', function(e) {.. native usage. Replace if you want a simple but less performant option. We also use the Velocity animation library to fade in the video. Again, replace this with another form of animation if you need!
Notes
is-fixed
class to the submenu when it has reached the top of the page.is-active
class to an anchor element when the user has scrolled to it's corresponding DOM NodeUsage
InitScripts initialization pattern
Vanilla Javascript initialization