I have a call like this:
$(\"#ContextMenuModal\").height($(\"body\").height());
However $(\"body\").height()
returns undefined
Simply use
$(document).height() // - $('body').offset().top
and / or
$(window).height()
instead $('body').height()
To expand a bit,
$(window).height(); // returns height of browser viewport
$(document).height(); // returns height of HTML document
As bažmegakapa points out, there is a slight difference, albeit a few pixels. The true height of the body can be calculated by subtracting the body offset from the document height (like I mentioned above):
$(document).height() - $('body').offset().top
Use this-
$("body").css("height")
well i will say jquery is not needed-
this.style.height;//it will not work if you add it as inline js.