15
rated 0 times
[
19]
[
4]
/ answers: 1 / hits: 32873
/ 12 Years ago, thu, january 24, 2013, 12:00:00
I have some CSS that needs the body to have a height set, but this needs to be done depending on the user.
I have made some code that kind of works - it calculates the window height but it's not changing the body height. What am I doing wrong?
function setWindowHeight(){
var windowHeight = window.innerHeight;
document.getElementsByTagName('body').style.height = windowHeight + px;
}
More From » css