使用jquery获取滚动位置 [英] Get scroll position using jquery

查看:86
本文介绍了使用jquery获取滚动位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

奇怪的请求,但我需要将当前浏览器的滚动位置作为变量。我应该使用什么js或jquery函数?我需要它来确定侧面显示的元素。我在网上发现了一些东西,但没有什么对我的div有用,只是整页。

Strange request, but I need to get the current browser scroll position as a variable. What js or jquery function should I use? I need it to figure out what elements to display on the side. I've found a few things online but nothing that works for my div, just the full page.

推荐答案

跨浏览器变体

$(document).scrollTop();

这篇关于使用jquery获取滚动位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆