- 8
- 0
- 约2.7千字
- 约 3页
- 2021-11-08 发布于江苏
- 举报
javascrip得t 到当前页面可视高度和宽度
function getHeight(){ var yScroll;
if (window.innerHeight window.scrollMaxY) { yScroll = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight document.body.offsetHeight){ // all but Explorer Mac yScroll = document.body.scrollHeight;
} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari yScroll = document.body.offsetHeight;
}
var windowHeight;
if (self.innerHeight) { // all except Explorer windowHeight = self.innerHeight;
} else if (document.documentElement document.documentElement.clientHeight) {
// Explorer 6 S
原创力文档

文档评论(0)