jqueryでウィンドウ最下部判定
登録日:2026-01-08
更新日:2026-01-13
jquery
$(window).on('scroll', function () {
const scrollTop = $(window).scrollTop();
const windowHeight = $(window).height();
const documentHeight = $(document).height();
if (scrollTop + windowHeight >= documentHeight) {
$('#target').fadeOut();
} else {
$('#target').fadeIn();
}
});