熟悉JS的高手帮我解释这段代码

[复制链接]
查看11 | 回复0 | 2010-4-21 11:36:37 | 显示全部楼层 |阅读模式
var diffY;//定议变量if (document.documentElement && document.documentElement.scrollTop)diffY = document.documentElement.scrollTop;else if (document.body)diffY = document.body.scrollTop;else //document.documentElement && document.documentElement.scrollTop是否存在这个属性,都存在执行diffY = document.documentElement.scrollTop;//document.documentElement.scrollTop;这是获取垂直滚动位置的方法//else if (document.body)如上解释
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行