Viewport vs Window Vs Document 视口 vs 窗口 vs 文档
- 论坛
- Viewport vs Window Vs Document 视口 vs 窗口 vs 文档
18 浏览
Viewport vs Window Vs Document 视口 vs 窗口 vs 文档
在下面的代码中,
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
和document.onload
?