Que tal, este es mi primer tema, aunque ya he posteado en otros algunas cosas.
Mi problema es el siguiente: Necesito que la imagen de fondo del body se expanda al tamaño de la ventana del browser y para eso estoy tratando de usar JS. Mi código disfuncional es el siguiente:
Código:
<script type="text/javascript">
function resize(){
var windowheight = window.screen.height;
var windowwidth = window.screen.width;
var bg = document.body.backgroundImage;
if ( bg < windowheight )
{ bg.style.height = windowheight;}
and if ( bg < windowwidth )
{ bg.style.width = windowwidth; }
}
</script>
Se agradece cualquier ayuda.