jquery how to get the page's current screen top position?

后端 未结 2 688
感情败类
感情败类 2020-12-14 14:30

jquery how to get the page\'s current screen top position?

If I scroll my mouse wheel to some part of the page, how do I get the page\'s current top position?

2条回答
  •  渐次进展
    2020-12-14 14:55

    var top = $('html').offset().top;
    

    should do it.

    edit: this is the negative of $(document).scrollTop()

提交回复
热议问题