Detect when Scroll reaches the BOTTOM of the page [ without jQuery ]

前端 未结 5 809
终归单人心
终归单人心 2020-12-14 03:20

I want to alert something when the scroll reaches the BOTTOM of the page, like this:

$(function(){
  $(document).scroll(function() {
    if($(document).scrol         


        
5条回答
  •  轮回少年
    2020-12-14 03:31

    This is working for me in IE

    document.onscroll = function() {
        if(document.documentElement.scrollTop + window.innerHeight == document.documentElement.scrollHeight)
        {
            alert('bottom');
        }
    }
    

    http://jsfiddle.net/cSer6/46/

提交回复
热议问题