![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
15/04/2013, 19:20
|
![Avatar de emprear](http://static.forosdelweb.com/customavatars/avatar187409_1.gif) | Colaborador | | Fecha de Ingreso: junio-2007 Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 17 años, 7 meses Puntos: 1567 | |
Respuesta: Como determinar el ancho del browser
Código HTML:
Ver original<!DOCTYPE html> <script type="text/javascript"> //<![CDATA[ function medidas(){ var winW,winH; if (document.body && document.body.offsetWidth) { winW = document.body.offsetWidth; winH = document.body.offsetHeight; } if (document.compatMode=='CSS1Compat' && document.documentElement && document.documentElement.offsetWidth ) { winW = document.documentElement.offsetWidth; winH = document.documentElement.offsetHeight; } if (window.innerWidth && window.innerHeight) { winW = window.innerWidth; winH = window.innerHeight; } document.getElementById('ancho').innerHTML = winW; document.getElementById('alto').innerHTML = winH; } //]]> <body onload="medidas();" onresize="medidas();">
Saludos
__________________ La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R. |