I need to give an element a specific height based on document\'s height and keep it whether the document size changes:
$(document).ready(function () {
$(
To calculate the height, try replacing document by window:
$(document).ready(function () {
$('#descriptive_news_text').height(($(window).height() - 325));
$(window).resize(function () {
$('#descriptive_news_text').height(($(window).height() - 325));
});
});
Something like this seems to work fine for me:
$(function() {
$("div#test").css("height", ($(document).height() - 325) + "px");
});