- reason:
- window.innerHeight called in Chrome level, return the browser's height
- window.innerHeight called in document level, return the viewpoint's height
- fixed using document.defaultView
This is a diagram taken from MDC:
#document
window main-window
...
browser
#document
window myExtensionWindow)
As you can see, since they are on different levels, calling window.innerHeight will gave different values. The higher <window> is the window for the whole browser, whereas the lower <window> is the window of the viewing plane.
No comments:
Post a Comment