innerHeight | outerHeight | clientHeight | bodyHeight | |
---|---|---|---|---|
ie7 | undefined | undefined | 496 | 30 |
ie8 | undefined | undefined | 496 | 30 |
ie9 | 500 | 1056 | 500 | 30 |
ie10 | 500 | 1056 | 500 | 30 |
FireFox | 500 | 1056 | 500 | 30 |
Chrome | 500 | 1040 | 500 | 30 |
outerHeight = innerHeight(clientHeight) + 顶部导航栏高度;(整个浏览器的高度)
bodyHeight = body被内容撑开的高度
综上:先获取innerHeight然后获取clientHeight