Buenassss...
Tengo un problemilla con unos iframes a la hora de que se ajuste el tamaño en Chrome y Safari. El scrollHeight aumenta bien pero no es capaz de reducir el tamaño cuando es necesario.
Parece que es un bug conocido.
Hablan de una posible ñapa para salir del paso aquí:
http://stackoverflow.com/questions/934323/iframe-height/3073888#3073888
Pero no consigo que funcione bien, ¿hay algo que se me escape en el script?
Código:
function autoajuste(idIframe)
{
if (document.getElementById(idIframe)!=null){
var body=document.getElementById(idIframe).contentWindow.document.body;
var ajusta=document.getElementById(idIframe).contentWindow.document.body.scrollHeight;
body.height="1px";
document.getElementById(idIframe).height=ajusta;
}
}
¡Muchas gracias por vuestra ayuda!