I need to add css height to each page dynamically with jquery.
So far I got the following code, but it does not add height to #wrapper.
Can anyone help me please?
Thanks in advance.
function getPageSizeWithScroll(){
if (window.innerHeight && window.scrollMaxY) {// Firefox
yWithScroll = window.innerHeight + window.scrollMaxY;
xWithScroll = window.innerWidth + window.scrollMaxX;
} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
yWithScroll = document.body.scrollHeight;
xWithScroll = document.body.scrollWidth;
} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
yWithScroll = document.body.offsetHeight;
xWithScroll = document.body.offsetWidth;
}
arrayPageSizeWithScroll = yWithScroll;
//alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );
return arrayPageSizeWithScroll;
}
var newheight = getPageSizeWithScroll() + 30;
$('#wrapper').css({'height':'newheight'});