I am using $(window).height(), but when I am resizing the window horizontally, it gives wrong values for just a moment. Lets say first its 974 , then it goes 957, then up again.
Asked
Active
Viewed 169 times
0
-
3Provide a [mcve] – charlietfl Apr 20 '17 at 15:04
-
you probably want to check your media query split points, its probably some element floated left which drops below at a particular screen width – andrew Apr 20 '17 at 15:07
-
you are right, it must be something like that – Erad Apr 20 '17 at 15:09
1 Answers
1
There can be multiple cases.
1) The most simple one: Add <!DOCTYPE HTML>
declaration to your HTML page ( http://viralpatel.net/blogs/jquery-window-height-incorrect/ )
2) It is possible that you are checking the console with firebug/ something else. So that you don't get window height correct due to firebug height.
See more info here why is $(window).height() so wrong?

Community
- 1
- 1

Mojo Allmighty
- 793
- 7
- 18