Foros del Web » Programando para Internet » Javascript »

Abrir Pop up a tamaño

Estas en el tema de Abrir Pop up a tamaño en el foro de Javascript en Foros del Web. Hola amigos, necesito un Scrip que me abra una imagen al tamño de la misma en una ventana pop up, por ejemplo tengo una galeria ...
  #1 (permalink)  
Antiguo 30/04/2002, 05:45
Avatar de benti  
Fecha de Ingreso: octubre-2001
Ubicación: Benidorm
Mensajes: 413
Antigüedad: 22 años, 6 meses
Puntos: 0
Abrir Pop up a tamaño

Hola amigos, necesito un Scrip que me abra una imagen al tamño de la misma en una ventana pop up, por ejemplo tengo una galeria de fotos de distintos tamaños y desearia tener un scrip que me habriera cualquierfoto a su justo tamaño.
Venga

Gracias y un saludo.
Benti
  #2 (permalink)  
Antiguo 30/04/2002, 07:14
Avatar de eloi  
Fecha de Ingreso: marzo-2002
Mensajes: 149
Antigüedad: 22 años, 1 mes
Puntos: 0
Re: Abrir Pop up a tamaño

<script>window.open("DIRECCION" , "Ventanita", "height=200,width=200,left=200,top=200") </script>

La DIRECCION cambiala y los 200 son el tamaño y la posicion en la pantalla.

<hr size="1"><font face="Verdana">[B]¿Buscas algun código?<br><input id="q"> <input type="submit" value="Buscar" onclick="document.location = &quot;http://www.webpersonal.net/elosan/indicecods.htm?info=enter,todos,&quot;+q.value+&qu ot;,0&quot;">
  #3 (permalink)  
Antiguo 30/04/2002, 07:17
Avatar de benti  
Fecha de Ingreso: octubre-2001
Ubicación: Benidorm
Mensajes: 413
Antigüedad: 22 años, 6 meses
Puntos: 0
Re: Abrir Pop up a tamaño

No me referia a habrir una ventana sino a que se habra la ventana al tamaño de la imagen sin tener que darle el tamaño yo, que lo haga el scrip.
Un saludo.

Gracias y un saludo.
Benti
  #4 (permalink)  
Antiguo 30/04/2002, 07:22
Avatar de eloi  
Fecha de Ingreso: marzo-2002
Mensajes: 149
Antigüedad: 22 años, 1 mes
Puntos: 0
Re: Abrir Pop up a tamaño

No creo que se pueda hacer que tome el tamaño de la imagen directamente, pero con ese código le pones el tamaño de la imagen manualmente

<hr size="1"><font face="Verdana">[B]¿Buscas algun código?<br><input id="q"> <input type="submit" value="Buscar" onclick="document.location = &quot;http://www.webpersonal.net/elosan/indicecods.htm?info=enter,todos,&quot;+q.value+&qu ot;,0&quot;">
  #5 (permalink)  
Antiguo 30/04/2002, 07:55
bet
 
Fecha de Ingreso: febrero-2001
Mensajes: 292
Antigüedad: 23 años, 2 meses
Puntos: 0
Re: Abrir Pop up a tamaño

Código:
&lt;html&gt;
&lt;head&gt;
&lt;title&gt; New Document &lt;/title&gt;

&lt;script language=&quot;javascript&quot;&gt;

var win = null;

function nuevaVentana(imag,nombre){

var imagen = new Image();
imagen.src = imag; 
imagen.name = 'imagen';

var w = imagen.width;
var h = imagen.height;

LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;


est =
'height=' + h + ',width=' + w + ',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,resizable';
win = window.open(&quot;&quot;,nombre,est);

win.document.open();
win.document.write(&quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;&quot;);
win.document.write(nombre);
win.document.write(&quot;&lt;/title&gt;&lt;/head&gt;&lt;body marginwidth='0' leftmargin='0' marginheight='0' topmargin='0'&gt;&lt;img src='&quot;);
win.document.write(imag);
win.document.write(&quot;'&gt;&lt;/body&gt;&lt;/html&gt;&quot;);
win.document.close();

}

&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;a href=&quot;javascript:;&quot; onClick=&quot;nuevaVentana('493-minoucoeur.gif','imagen');return false&quot;&gt;
Abrir Imagen&lt;/a&gt;

&lt;/body&gt;
&lt;/html&gt;




<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 03:37.