I am using ASP.NET and C#. I need to change the height of the div tag based on the screen resolution. This is what i tried.
function setHeight() {
var footer = document.getElementById('footerSection').offsetHeight;
var h = document.documentElement.offsetHeight - footer;
document.getElementById('rightContent').style.height = h+"px";
};
I am calling this script from onload of body tag like this.
<body onload="setHeight();">
It is working, But this height is assigning to that div after the rendering get finished. So that first it displays with the height that assigned based on the content inside that after some fraction of second the height get changed to what i assigned.
So is it possible to set the height before rendering or before it gets loaded into the window? Actually i do not want user to see that height change.