答案 0 :(得分:3)
不需要插件:
$(window).scroll(function() {
var windowHeight = $(window).height(),
documentHeight = $(document).height(),
scroll = $(window).scrollTop();
if (windowHeight + scroll + 200 > documentHeight ) {
// show the link bar
}
});
当你在底部的200像素范围内时,这将显示链接栏。 windowHeight
将保持屏幕可见部分的高度,documentHeight
将保持页面的总高度,包括您可以看到和看不到的内容,scroll
将保持如何远离您滚动的文档顶部(从0开始)。
希望这会有所帮助:)