You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was losing my mind to find why it wasn't working!
When the doctype is set, document.body.clientHeight returns a bigger value than expected, the same height as the body instead of the height of the actual viewport.
Maybe the solution here is to replace document.body.clientHeightwith document.documentElement.clientHeight ?
The text was updated successfully, but these errors were encountered:
Since, as you pointed out, document.body.clientWidth doesn't work as expected when the doctype is declared, a simpler solution would be to directly replace document.body.clientHeight in favor of window.innerHeight (document.documentElement.clientHeight doesn't work when the doctype is not declared):
Found a bug when having doctype declared.
When the doctype is set,
document.body.clientHeight
returns a bigger value than expected, the same height as thebody
instead of the height of the actual viewport.Maybe the solution here is to replace
document.body.clientHeight
withdocument.documentElement.clientHeight
?The text was updated successfully, but these errors were encountered: