Browse Source

Detect scroll to footer

develop
MEUNIER Thibaud 6 years ago
parent
commit
0684c9c627
1 changed files with 17 additions and 0 deletions
  1. +17
    -0
      index.php

+ 17
- 0
index.php View File

@ -33,6 +33,12 @@
});
$(window).scroll(function() {
if (isInViewport(document.querySelector('footer')))
{
blockchainExplorer.addBottomBlock();
console.log("Scroll to footer detected !");
}
/*
$(".slideanim").each(function(){
var pos = $(this).offset().top;
var winTop = $(window).scrollTop();
@ -41,11 +47,22 @@
$(this).addClass("slide");
}
});
*/
});
blockchainExplorer.init(1);
});
var isInViewport = function (elem) {
var bounding = elem.getBoundingClientRect();
return (
bounding.top >= 0 &&
bounding.left >= 0 &&
bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
bounding.right <= (window.innerWidth || document.documentElement.clientWidth)
);
};
function showInfos(element)
{
$('#blockchain').html('');

Loading…
Cancel
Save