How do I get the scroll position of a document?

前端 未结 9 1755
面向向阳花
面向向阳花 2020-12-12 20:53

How to get the scroll position value of a document?

9条回答
  •  臣服心动
    2020-12-12 21:19

    If you are using Jquery 1.6 or above, use prop to access the value.

    $(document).prop('scrollHeight')
    

    Previous versions used to get the value from attr but not post 1.6.

提交回复
热议问题