Erad
Erad

Reputation: 3

$(window).height() gives incorrect values on horizontal resize

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.

console

Upvotes: 0

Views: 176

Answers (1)

Mojo Allmighty
Mojo Allmighty

Reputation: 793

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?

Upvotes: 1

Related Questions