I’m trying to get the current browser viewport height, using
$(window).on('resize',function() {
console.log("new height is: "+$(window).height());
});
But I’m getting values that are way too low. When the viewport is around 850px tall, I’m getting values around 350 or 400px from height(). What’s up?
One possible reason may be that you are checking the console with firebug/ something else. So that you don’t get window height correct due to firebug height.
You can try something like this:
take a span/div in you document:
and then
Or if you want to check out put on firebug console then detach it from browser and then check the result.