Created
October 11, 2016 14:14
-
-
Save putzflorian/a971bd73f596e45957bacb91ac9a89fe to your computer and use it in GitHub Desktop.
scroll to reload
This file contains hidden or 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
if(device.mobile()){ | |
var nearToBottom = 2000; | |
} else { | |
var nearToBottom = 1000; | |
} | |
$(window).scroll(function () { | |
if ($(window).scrollTop() + $(window).height() > $(document).height() - nearToBottom) { | |
relaod(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment