获取元素在页面的绝对位置
源代码:
以下是代码片段: var getCoords = function (el) { |
其中self.pageYOffset为window.self.pageYOffset,是火狐的一个属性,相当于document.body.scrollTop。以下是它的定义:
Definition: The pageYOffset property is used to determine the Y coordinate of the scroll position in some browsers. This is not a reserved word so you can declare your own variable or function called pageYOffset but if you do then you will not be able to find or alter the scroll position of a window in some browsers.
扫一扫订阅我的微信号:IT技术博客大学习
- 作者:小寒 来源: 记事本
- 标签: 绝对位置
- 发布时间:2010-08-04 00:06:48
-
[83] memory prefetch浅析
-
[53] 转载:cassandra读写性能原理分析
-
[51] 深入浅出cassandra 4 数据一致性问
-
[51] 基本排序算法的PHP实现
-
[46] 字符引用和空白字符
-
[41] Inline Form Labels
-
[41] MySQL半同步存在的问题
-
[40] JS中如何判断字符串类型的数字
-
[40] 获取Dom元素的X/Y坐标
-
[40] javascript插入样式