Ver Mensaje Individual
  #4 (permalink)  
Antiguo 06/02/2008, 23:54
Avatar de caricatos
caricatos
Moderador
 
Fecha de Ingreso: abril-2002
Ubicación: Torremolinos (Málaga)
Mensajes: 19.607
Antigüedad: 22 años, 11 meses
Puntos: 1284
Re: Iframe Dinamico URGENTE, YA NO DOY MAS!!!

Hola:

Prueba con este código:
La página principal:

Código:
<html>
<head>
<script>
function tag(id) {return document.getElementById(id);}
function redimencionarIframe(ancho, alto) {
	with(tag("visor").style) {
		width = ancho + "px";
		height = alto + "px";
	}
}
</script>
</head>
<body>
<a href="verImagen.php?imagen=Lupa.png" target="visor" >Enlazando</a>
<br />
<iframe name="visor" id="visor" style="width: 300px; height: 200px" ></iframe>

</body>
</html>
Y la imagen (verImagen.php):

Código:
<? $imagen = $_GET["imagen"]; ?>
<html>
<head>
<style>
*	{
	margin: 0;
	padding: 0;
	overflow: hidden;
}
</style>
</head>
<body>
<img src="<?=$imagen; ?>" onload="parent.redimencionarIframe(this.width, this.height)" />
</body>
</html>
Lo puse con un enlace y el iframe en php... al verImagen.php le tienes que pasar una url válida.

Saludos
__________________
Por favor:
No hagan preguntas de temas de foros en mensajes privados... no las respondo