Ver Mensaje Individual
  #9 (permalink)  
Antiguo 02/07/2011, 17:21
ngollum
 
Fecha de Ingreso: julio-2011
Mensajes: 1
Antigüedad: 12 años, 10 meses
Puntos: 0
Respuesta: scroll de iframe a la pagina entera

Buenas,
He probado el código y no me ha fucionado, os dejo el código de mi página:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>

<title>Pagina principal</title>
<script language="JavaScript">
function resizeIframe(ID,NOMBRE){

document.getElementById(ID).height=null;
document.getElementById(ID).width=null;
var m=getWindowData(NOMBRE,ID);
document.getElementById(ID).height=m[5];
document.getElementById(ID).width=m[4]+22;

}

function getWindowData(n,i){

var ifr=document.getElementById(i).contentWindow.docum ent || document.getElementById(i).contentDocument;
var widthViewport,heightViewport,xScroll,yScroll,width Total,heightTotal;
if (typeof window.frames[n].innerWidth != 'undefined'){
widthViewport= window.frames[n].innerWidth;
heightViewport= window.frames[n].innerHeight;
}else if(typeof ifr.documentElement != 'undefined' && typeof ifr.documentElement.clientWidth !='undefined' && ifr.documentElement.clientWidth != 0){
widthViewport=ifr.documentElement.clientWidth;
heightViewport=ifr.documentElement.clientHeight;
}else{
widthViewport= ifr.getElementsByTagName('body')[0].clientWidth;
heightViewport=ifr.getElementsByTagName('body')[0].clientHeight;
}
xScroll=window.frames[n].pageXOffset || (ifr.documentElement.scrollLeft+ifr.body.scrollLef t);
yScroll=window.frames[n].pageYOffset || (ifr.documentElement.scrollTop+ifr.body.scrollTop) ;
widthTotal=Math.max(ifr.documentElement.scrollWidt h,ifr.body.scrollWidth,widthViewport);
heightTotal=Math.max(ifr.documentElement.scrollHei ght,ifr.body.scrollHeight,heightViewport);
return [widthViewport,heightViewport,xScroll,yScroll,width Total,heightTotal];

}
</script>

</head>
<body>
<iframe scrolling="no" frameborder="0" id="bloque_izquierdo" name="bloque_izquierdo" class="bloque_izquierdo" onload="resizeIframe('bloque_izquierdo','bloque_iz quierdo');"></iframe>

<div class="division_lateral" style="left:11.8em;"></div>

<iframe scrolling="no" frameborder="0" id="bloque_central" name="bloque_central" class="bloque_central" onload="resizeIframe('bloque_central','bloque_cent ral');"></iframe>

<div class="division_lateral" style="left:50.5em;"></div>

<iframe scrolling="no" frameborder="0" id="bloque_derecho" class="bloque_derecho" onload="resizeIframe('bloque_derecho','bloque_dere cho');"></iframe>

</iframe>

</body>
</html>

Podéis decirme dónde está el fallo??
Muchísimas gracias!!!