Hi this is my code which I use on one div in order to automatically set its height to window one. The script works great in Firefox but not in Chrome or Safari. I tried few methods to fix it including some from previous posters but without effect, unfortunatelly. I think that the problem is hiding somewhere in document.getElementById("ID").style.height but I am not completely sure. I will be glad if someone can help. Thanks in advance! 🙂
window.onload = Resize;
window.onresize = Resize;
function Resize() {
if (document.documentElement.scrollHeight === document.documentElement.clientHeight)
{
document.getElementById("ID").style.height = (window.innerHeight-220) + "px";
}
};
try this
This will set the height of the ID to the height of the browser window + the vertical scroll offset.