Created
January 8, 2014 12:35
-
-
Save swape/8316174 to your computer and use it in GitHub Desktop.
This script calls a function when scrolling 90px from end of the screen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mLock = true; | |
$(window).scroll(function(){ | |
if (document.body.scrollHeight <= document.body.scrollTop + window.innerHeight + 90 ){ | |
if(mLock){ | |
mLock = false; | |
doSomeFunction(); | |
} | |
} | |
}); | |
doSomeFunction(){ | |
// crazy loading content via ajax and stuff | |
mLock = true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment