Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>When I needed such a functionality some years ago, I examined how <a href="http://www.google.com/calendar/" rel="nofollow">Google Calendar</a> did it.</p> <p>Basically, they use a timer-driven JavaScript file that checks for the height of the window and adjust the height of a contained DIV tag accordingly (or of an IFRAME tag, just any container tag that you like).</p> <p>Here is a code snippet from a page I worked on:</p> <pre><code>&lt;script type="text/javascript"&gt; document.getElementsByTagName("body")[0].style.height = "100%"; document.getElementsByTagName("html")[0].style.height = "100%"; document.getElementsByTagName("body")[0].style.minHeight = "100%"; document.getElementsByTagName("html")[0].style.minHeight = "100%"; function height() { try { height_iframe(); } catch(err) { } } window.onload=height; // -- var ie6WorkaroundIFrameResize = 1; function height_iframe() { var any = false; var offset = 300; var c = document.getElementById("iframecontent"); if ( c!=null ) { c.style.height = (GetClientHeight()-offset)+"px"; any = true; var d = document.getElementById("iframeie6"); if ( d!=null ) { d.style.height = (GetClientHeight()-(offset+ie6WorkaroundIFrameResize))+"px"; any = true; ie6WorkaroundIFrameResize = 0; } } if ( any ) { setTimeout( 'height_iframe()', 300 ); } } function GetClientHeight() { return document.documentElement.clientHeight; } &lt;/script&gt; </code></pre> <p>Basically, the script regularly checks for the height of the window via the <code>GetClientHeight()</code> function and adjusts the element in concern ("iframecontent") accordingly.</p> <p>I subtract some offsets of fixed-height headers and footers.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload