How to check if a DIV is scrolled all the way to the bottom with jQuery

后端 未结 8 505
盖世英雄少女心
盖世英雄少女心 2020-12-08 00:27

I have a div with overflow:scroll.

I want to know if it\'s currently scrolled all the way down. How, using JQuery?

This one doesn\'t work: How can I determin

相关标签:
8条回答
  • 2020-12-08 01:19

    You can do that by

    (scrollHeight - scrollTop()) == outerHeight()
    

    Apply required jQuery syntax, of course...

    0 讨论(0)
  • 2020-12-08 01:21

    Without jquery, for onScroll event

    var scrollDiv = event.srcElement.body
    window.innerHeight + scrollDiv.scrollTop == scrollDiv.scrollHeight
    
    0 讨论(0)
提交回复
热议问题