Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   HTML, Javascript y otros (https://www.clubdelphi.com/foros/forumdisplay.php?f=38)
-   -   En un hipervínculo abrir la ventana de Internet Explorer maximizada (https://www.clubdelphi.com/foros/showthread.php?t=67019)

David 24-03-2010 10:37:29

En un hipervínculo abrir la ventana de Internet Explorer maximizada
 
Hola

tengo un sencillo código html:

Código:

<a href="http://wwww.google.es"  target="_blank" ><img src="http://thumbs.dreamstime.com/thumb_311/1221597609xN9DwP.jpg" name="Image10" width="155" height="149" border="0"></a>

y cuando dentro de internet Explorer pulso en la imagen, se abre la nueva ventana, pero no maximizada, sino digamos un tamaño medio.

Lo que quiero es que la nueva ventana se abra maximizada.

He intentado este código en javascript, pero no funciona, la ventana del hipervínculo se queda delante, se vuelve a recargar.

Código:

<script language="javascript">
//esta función iria en el evento onclick de la etiqueta <a onclick..., pero no lo hace bien
function gotohere(enlace)
{
       
        window.moveTo(0,0);
    window.resizeTo(screen.availWidth,screen.availHeight);
        window.location.target='_blank';
    window.location.href='http://www.google.es';
}
</script>

Saludos

roman 25-03-2010 06:50:20

Intenta así:

Código:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<title> prueba </title>
<script type='text/javascript'>
function abrir(enlace)
{
    var w = screen.availWidth;
    var h = screen.availHeight;
    var ventana = window.open(enlace.href, '', 'left=0,top=0,width=' + w + ',height=' + h);

    return false;
}
</script>
</head>

<body>
<a href='http://google.com'  target='_blank' onclick='return abrir(this)'>Google</a>
</body>
</html>

// Saludos


La franja horaria es GMT +2. Ahora son las 06:54:37.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi