Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Total Page Scroll Control Reply To: Total Page Scroll Control

#265768
Beverleyh
Participant

If only you’d posted this question a month ago… I did exactly that here http://fofwebdesign.co.uk/template/_writing/a-mince-pie-too-many/

Scroll to the bottom for the articles that cover the JavaScript, and view the source to examine in more detail, but basically, the elementFromTop() function watches for when a section (a candy cane bar) hits the top of the viewport. When that happens, it adds 2 classes to the element being animated; an animated class, and an animation-name class, which are taken from the animate.css library (a good portion of them anyway – some animations are custom, or from magic.css, but I continued using the same logic for convenience).