获取元素在页面的绝对位置
源代码:
|
以下是代码片段: 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
-
[782] WordPress插件开发 -- 在插件使用 -
[62] Java将Object对象转换为String -
[61] cookie窃取和session劫持 -
[59] 学习:一个并发的Cache -
[55] 你必须了解的Session的本质 -
[53] 再谈“我是怎么招聘程序员的” -
[52] Linux如何统计进程的CPU利用率 -
[49] 最萌域名.cat背后的故事:加泰与西班牙政府 -
[48] 解读iPhone平台的一些优秀设计思路 -
[48] 我对技术方向的一些反思