Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/08/2007, 15:54
Avatar de manumaf
manumaf
 
Fecha de Ingreso: mayo-2007
Ubicación: Argentina
Mensajes: 854
Antigüedad: 16 años, 11 meses
Puntos: 6
Cambiar tamaño de iframe segun su contenido

Como ago que para que un iframe carie su tamaño cuando cargue un pagina dentro de el y que el tamaño que tome es el de esa pagina

Me habian dado un codigo asi pero no me funciona miren:

Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Iframes prueva!</title>
<SCRIPT LANGUAGE=javascript>
<!--
function reSize()
{
	try{	
	var oBody	=	ifrm.document.body;
	var oFrame	=	document.all("ifrm");
		
	oFrame.style.height = oBody.scrollHeight + (oBody.offsetHeight - oBody.clientHeight);
	oFrame.style.width = oBody.scrollWidth + (oBody.offsetWidth - oBody.clientWidth);
	}
	//An error is raised if the IFrame domain != its container's domain
	catch(e)
	{
	window.status =	'Error: ' + e.number + '; ' + e.description;
	}
}
//-->
</SCRIPT></head>
<BODY onload=reSize()>

<iframe src=YOUR_PAGE_HERE name="z1" width="" height="" align="left" scrolling="No" frameborder="3" id=z1 onresize=reSize()>
</iframe>
</BODY>
</html> 

Cual es el error o que otro codigo puedo usar o otra forma de hacerlo


Aqui hay una web de de ejemplo que usa un iframe que cambia de tamño segun el contenido miren:
www.habbotools.de