[英]How to obtain the screen's height position in a long html page?
I have a sliding screen on a long HTML page with left and right columns. 我在带有左右列的HTML长页面上有一个滑动屏幕。 How can I obtain the height position of the screen in the HTML page, knowing users use sliding bars?
在知道用户使用滑动条的情况下,如何获得HTML页面中屏幕的高度位置? I need this to slide the left and right column content to follow users' movement.
我需要它来滑动左右列的内容,以跟随用户的移动。 Thanks.
谢谢。
PS: I am using JQuery (if it helps). PS:我正在使用JQuery(如果有帮助)。
You can use scrollTop
to find the vertical scroll position of any DOM element. 您可以使用
scrollTop
查找任何DOM元素的垂直滚动位置。
$('#element').scrollTop()
Some other useful functions: scrollLeft()
, offset()
, position()
其他一些有用的函数:
scrollLeft()
, offset()
, position()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.