Demo Mengganti Ukuran Element Secara Otomatis
by Mas Aab
HTML
<div id="headekur"><h1>Headerku "ubah ukuran"</h1></div>
<div id="contentku">Dinamic Contentku</div>
<div id="footerku">Footerku</div>
CSS
#contentku {
border: 1px solid black;
}
JavaScript
$(window).resize(function() {
var spasi = $(window).height() - ($("#headerku").height() + $("#footerku").height());
$("#contentku").height(spasi);
});
$(window).trigger('resize');