Skip to content

Instantly share code, notes, and snippets.

@jedahan
Created May 16, 2014 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jedahan/d0686225e397767a9e91 to your computer and use it in GitHub Desktop.
Save jedahan/d0686225e397767a9e91 to your computer and use it in GitHub Desktop.
var addMore = function(ev) {
if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight) {
// you're at the bottom of the page
var div = document.createElement('div')
div.setAttribute("style", "font-family: sans-serif; font-size: 500%;")
div.innerHTML = "POLARIZING. MERCURIAL. FORCEFUL. FEARELESS. TALENTED. STUBBORN. CONDESCENDING. DIFFICULT. UNREASONABLE. IMPOSSIBLE. DISENGAGED. UNCARING. UNPOPULAR. PUSHY. HARD. BRUSQUE."
document.body.appendChild(div)
}
}
window.onscroll = addMore;
addMore(); // Run this function a few times at the beginning, then firefox is happy
addMore(); // This is a hack, basically window.onscroll will not fire unless you scroll
addMore(); // But if the page isn't long enough for scrolling to be necessary, you cannot scroll!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment