It seems to me that Firefox ought to be better equipped to return the proper value when using $(window).height()
.
I am using jQuery 1.8.2. Is this a bug in that particular build? Every other browser I have tested returns an appropriate value when calculating viewport height.
To work around this, I've used snip below to apply a pixel value to a div.
$(window).bind('cwsObjectsShown', function() {
var height = $(window).height();
if (height === 0) {
height = window.innerHeight;
}
height = height - '120';
$('#game_objects').css('height', height + 'px');
});
<head>
of the document, before anything has loaded: jsfiddle.net/bdukes/HDrnx – Pancreatotomy