ソースを参照

Detect scroll to footer

develop
コミット
0684c9c627
1個のファイルの変更17行の追加0行の削除
  1. +17
    -0
      index.php

+ 17
- 0
index.php ファイルの表示

@ -33,6 +33,12 @@
}); });
$(window).scroll(function() { $(window).scroll(function() {
if (isInViewport(document.querySelector('footer')))
{
blockchainExplorer.addBottomBlock();
console.log("Scroll to footer detected !");
}
/*
$(".slideanim").each(function(){ $(".slideanim").each(function(){
var pos = $(this).offset().top; var pos = $(this).offset().top;
var winTop = $(window).scrollTop(); var winTop = $(window).scrollTop();
@ -41,11 +47,22 @@
$(this).addClass("slide"); $(this).addClass("slide");
} }
}); });
*/
}); });
blockchainExplorer.init(1); 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) function showInfos(element)
{ {
$('#blockchain').html(''); $('#blockchain').html('');

読み込み中…
キャンセル
保存