Ver Mensaje Individual
  #88 (permalink)  
Antiguo 07/01/2003, 11:33
chivi
 
Fecha de Ingreso: diciembre-2001
Ubicación: Madrid
Mensajes: 889
Antigüedad: 22 años, 3 meses
Puntos: 4
88. Detectar Resolución y Redireccionar

P: ¿Cómo puedo mostrar la resolución de la pantalla del usuario y con un simple enlace redireccionarle a la página apropiada?

R:
Código PHP:
<html>
<
head>
<
script>
var 
resurl
if ((screen.width == 800) && (screen.height == 600)){
res="800x600"
url="800x600.htm"}
else if ((
screen.width == 1024) && (screen.height == 768)){
res="1024x768";
url="1024x768.htm"}
else if ((
screen.width == 1152) && (screen.height == 864)){
res="1152x864";
url="1152x864.htm"}
else if ((
screen.width == 1280) && (screen.height == 1024)){
res="1280x1024";
url="1280x1024.htm"}
else{
window.location.href "otra.htm"}
function 
Entrar(){
window.location.href=url}
</script>
</head>
<body>
Tu Resolución de Pantalla es: <b><script>document.write(res)</script></b><br>
<a href="javascript:Entrar()">Acceda a la página correspondiente a tu resolución</a>
</body>
</html>