I have a site using a body background image. When the browser is resized, I want to change the body class.
JavaScript:
function MOSTRA() {
var SCR = screen.availWidth
var BRW = window.outerWidth
if BRW < SCR {
document.getElementById(BODY).className = 'BDYL'
}
else {
document.getElementById(BODY).className = 'BDNL'
}
}
HTML:
<body id="BODY" class="BDNL" onResize="MOSTRA()">
I thought the class would be changed (to one that is Background-size:auto), but it isn't. How can i change the background size or the whole class? I can't use more than Javascript, HTML, or CSS.