How do you know the scroll bar has reached bottom of a page

后端 未结 4 781
悲哀的现实
悲哀的现实 2020-12-11 01:37

I have a HTML page, when the scroll bar reaches bottom of the page I need to slide in a div from bottom-right containing an iframe.

Using JQuery I have implemented

4条回答
  •  一个人的身影
    2020-12-11 02:15

    You would to use the scroll function in jquery to check the position if it has reached document.height or window.height values. Something along the lines of this (I haven't verified it)

    $(window).scroll(function(){ 
       console.log($(window).scrollTop() == ($(document).height() - $(window).height()));
    })
    

提交回复
热议问题