Foros del Web » Programando para Internet » Javascript »

Abrir una ventana en el centro

Estas en el tema de Abrir una ventana en el centro en el foro de Javascript en Foros del Web. Si alguien puede ayudarme, me gustaría que al abrir una ventana se abriese en el centro de la página. Gracias...
  #1 (permalink)  
Antiguo 08/03/2002, 11:09
 
Fecha de Ingreso: febrero-2002
Mensajes: 45
Antigüedad: 22 años, 3 meses
Puntos: 0
Abrir una ventana en el centro

Si alguien puede ayudarme, me gustaría que al abrir una ventana se abriese en el centro de la página. Gracias
  #2 (permalink)  
Antiguo 08/03/2002, 11:15
bet
 
Fecha de Ingreso: febrero-2001
Mensajes: 292
Antigüedad: 23 años, 2 meses
Puntos: 0
Re: Abrir una ventana en el centro

Código:
<html>
<head>
<title> New Document </title>

<script language="javascript">

var win = null;
function nuevaVentana(pagina,nombre,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
estilo =
'height=' + h + ',width=' + w + ',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(pagina,nombre,estilo)
}
</script>
</head>

<body onLoad="nuevaVentana(this.href,'name','300','200','yes');return false">

</body>
</html>
<hr noshade size=1><img src="http://www.gograph.com/Images-8712/ClipArt/cat03.gif" height="50" border=0 align="absmiddle"> <font size="2" face="verdana" color="#000000">bet[/CODE]
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 06:47.