
Untitled
By: a guest on
Aug 12th, 2012 | syntax:
None | size: 0.44 KB | hits: 7 | expires: Never
Align element to bottom of window but allow scrolling to content underneath
var resize = function () {
var availHeight = window.innerHeight;
// you need to either calculate
// or set a fixed offset from the top for content above
var offset = 80;
document.getElementById("slider").style.height = availHeight - offset + "px";
}
window.addEventListener("resize", resize, false);
window.addEventListener("load", resize, false);