Created
October 7, 2015 17:52
-
-
Save brunohaveroth/513ed9d45564360bdd48 to your computer and use it in GitHub Desktop.
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
$(document).scroll(function() { | |
var top = document.body.scrollTop; | |
var maxTop = document.body.scrollHeight - document.body.clientHeight; | |
if (parseInt(top) === maxTop) { | |
console.log('Chegou ao fim da página') | |
} | |
}); |
Queria implementar um simples contador mas ele não incrementa de modo algum.
`$(document).scroll(function() {
var top = document.body.scrollTop;
var maxTop = document.body.scrollHeight - document.body.clientHeight;
var contadorRolagemPg = 0;
if (parseInt(top) === maxTop) {
contadorRolagemPg += 1
console.log(contadorRolagemPg);
}
});`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ao topo da página, não ao fim.