Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. // This is the event "onscroll" on the window object, that we're binding to and passing an
  2. // anonymous function as the function to be executed when the event is triggered
  3. window.onscroll = function (event) {
  4. // Then here (inside the anonymous function that's being passed in), we add the class
  5. // "my-class" to the document body.
  6. document.body.classList.add("my-class");
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement