获取元素在页面的绝对位置
源代码:
以下是代码片段: 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
-
[76] memory prefetch浅析
-
[51] find命令的一点注意事项
-
[37] 基本排序算法的PHP实现
-
[33] 卡诺模型―设计品质与设计价值的思考
-
[32] Oracle bbed工具的编译
-
[26] 程序员技术练级攻略
-
[26] 8大实用又重要Mac使用技巧
-
[24] 读书笔记-壹百度:百度十年千倍的29条法则
-
[24] 两行 JavaScript 代码
-
[21] 小屏幕移动设备网页设计注意事项