Detect scroll to footer
This commit is contained in:
17
index.php
17
index.php
@@ -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('');
|
||||
|
||||
Reference in New Issue
Block a user