For my purposes, I need to set the div height as quickly as possible.
Using the document.ready() event is not fast enough, so I want to set the inline CSS style of the div.
How can achieve something like this?
<div id="map-container" style="height:javascript(getwindowheight)px;">
<div id="map">
</div>
</div>
function getwindowsheight() {
return window.height;
}
Any suggestions?
Since you want it to be dynamic, you will need to pay attention to the following events:
Set your HTML first:
And then inside your JavaScript, setup a function to detect those: