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