Skip to content

Instantly share code, notes, and snippets.

@kylehill
Last active November 27, 2016 17:47
Show Gist options
  • Save kylehill/0e45f0b98508fc2ff74f9d0c3ecacec9 to your computer and use it in GitHub Desktop.
Save kylehill/0e45f0b98508fc2ff74f9d0c3ecacec9 to your computer and use it in GitHub Desktop.
Check Body ScrollHeight on a loop
var currentHeight = 0;
var checkHeight = function() {
if (document.body.currentHeight !== currentHeight) {
executeSomeFunctionHereToApplyLinks()
currentHeight = document.body.currentHeight
}
setTimeout(500, checkHeight) // execute this again 500ms later
}
checkHeight()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment