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

后端 未结 2 685
感情败类
感情败类 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 15:11

    Use this to get the page scroll position.

    var screenTop = $(document).scrollTop();
    
    $('#content').css('top', screenTop);
    

提交回复
热议问题