【发布时间】:2016-02-19 15:03:28
【问题描述】:
在下面的代码中,
document.documentElement.clientWidth
1349
document.documentElement.clientHeight
363
window.innerWidth
1366
window.innerHeight
363
window.screen.height
768
window.screen.width
1366
所以,我的桌面屏幕是 1366 像素宽和 768 像素高。
我知道了,
使用document.documentElement.clientWidth 和document.documentElement.clientHeight 引用视口尺寸。
使用window.innerWidth 和window.innerHeight 引用窗口尺寸。
1) 视口和文档有什么区别?
2) window.onload Vs document.onload 什么时候被调用?
【问题讨论】:
标签: javascript html css dom