Ver Mensaje Individual
  #3 (permalink)  
Antiguo 09/02/2007, 04:45
erponcios
 
Fecha de Ingreso: abril-2006
Mensajes: 218
Antigüedad: 18 años, 11 meses
Puntos: 0
Re: Problema con cambio de background segun resolución

Muchas gracias caricatos, tengo puesto esto:

Código HTML:
<script language="JavaScript"> 

	if (screen.width + "x" +screen.height == "800x600") document.body.backgroundImage = "url(fondo8.jpg)";
	if (screen.width + "x" +screen.height == "1024x768") document.body.backgroundImage = "url(fondo10.jpg)";
	if (screen.width + "x" +screen.height == "1280x1024") document.body.backgroundImage = "url(fondo12.jpg)";
	if (screen.width + "x" +screen.height == "1600x1200") document.body.backgroundImage = "url(fondo16.jpg)";
 
</script> 
El problema es que no me pone ningun background, aquí puedes ver el ejemplo:

http://www.informagestudios.com/web.html

¿seguro que es document.body.backgroundImage? es que he visto que document.body.background también existe y document.getElementById('bodys').style.backgroundI mage también, lo que pasa es que no se si al body se le puede dar un id.

Un saludo y muchas gracias.

Última edición por erponcios; 09/02/2007 a las 05:23