【发布时间】:2023-02-23 00:53:56
【问题描述】:
如果用户滚动到页面上的某个位置,我想显示一个元素。 但我也想在用户到达页面末尾时隐藏该元素。
现在我只有显示元素的代码:
( function( $ ) {
$(document).scroll(function() {
var y = $(this).scrollTop();
if (y > 800) {
$('.sticky-bottom').fadeIn();
} else {
$('.sticky-bottom').fadeOut();
}
});
} ( jQuery ) );
但是我怎样才能把它隐藏在页面的末尾呢?完全不像.scrollBottom。
【问题讨论】:
标签: javascript html jquery scrolltop