PDA

Ver la Versión Completa : Resolución de pantalla



Guru
18/08/2006, 14:42
¿Como redireccionar mi sitio a diferentes carpetas dependiendo de la resolución del browser del usuario?


<html>
<head>
**********<script language="JavaScript">
********** function redireccionar() {
********** **********var url640x480 = "http://www.tu--sitio.com/640x480";
********** **********var url800x600 = "http://www.tu--sitio.com/800x600";
********** **********var url1024x768 = "http://www.tu--sitio.com/1024x768";
********** **********var nWdt = screen.width;
********** **********var nHgh = screen.height;
********** **********if ((nWdt == 640) && (nHgh == 480)) window.location.href= url640x480;
********** **********else if ((((nWdt == 800) && (nHgh == 600)) window.location.href= url800x600;
********** **********else if ((nWdt == 1024) && (nHgh == 768)) window.location.href= url1024x768;
********** **********else window.location.href= url640x480;
********** }
**********</script>
</head>
<body onLoad="redireccionar()">
</body>
</html>

Espero les sea de utilidad!