Ver Mensaje Individual
  #2 (permalink)  
Antiguo 20/11/2008, 18:54
Avatar de Fernand0
Fernand0
 
Fecha de Ingreso: septiembre-2005
Ubicación: Buenos Aires
Mensajes: 610
Antigüedad: 19 años, 4 meses
Puntos: 19
Respuesta: Centrar <div...> de acuerdo a pantalla

Código javascript:
Ver original
  1. var Div=document.getElementById('div');
  2. Div.style.position='fixed';
  3.  
  4. var w=parseInt(Div.style.width);
  5. var h=parseInt(Div.style.height);
  6.  
  7. Div.style.left=(document.body.offsetWidth/2-(w/2))+'px';
  8. Div.style.top=(document.body.offsetHeight/2-(h/2))+'px';