I have a problem using $(window).height(). When I first load the page, it shows 0, I can only get the right number after refreshing it.
I tried to put it in $(document).ready(function(){}), in the beginning of JavaScript, in the $('[data-role="page"]').live('pageshow', function () {}) (it’s a jquery mobile site), but nothing works.
How can I get the window height on loading the file without refreshing it?
Try the following:
but the window height is basically always the same. you might want the document body height :