Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is the event "onscroll" on the window object, that we're binding to and passing an
- // anonymous function as the function to be executed when the event is triggered
- window.onscroll = function (event) {
- // Then here (inside the anonymous function that's being passed in), we add the class
- // "my-class" to the document body.
- document.body.classList.add("my-class");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement