Ver Mensaje Individual
  #5 (permalink)  
Antiguo 17/09/2010, 20:50
Milen
 
Fecha de Ingreso: octubre-2008
Mensajes: 81
Antigüedad: 15 años, 5 meses
Puntos: 3
Respuesta: scroll de iframe a la pagina entera

Bueno, hace tiempo tuve ese problema y lo solucione con las funciones javascript:

Código Javascript:
Ver original
  1. function resizeIframe(ID,NOMBRE){
  2.    
  3.     document.getElementById(ID).height=null;
  4.     document.getElementById(ID).width=null;
  5.     var m=getWindowData(NOMBRE,ID);
  6.     document.getElementById(ID).height=m[5];
  7.     document.getElementById(ID).width=m[4]+22;
  8.    
  9. }
  10.  
  11. function getWindowData(n,i){
  12.    
  13.     var ifr=document.getElementById(i).contentWindow.document || document.getElementById(i).contentDocument;
  14.     var widthViewport,heightViewport,xScroll,yScroll,widthTotal,heightTotal;
  15.     if (typeof window.frames[n].innerWidth != 'undefined'){
  16.         widthViewport= window.frames[n].innerWidth;
  17.         heightViewport= window.frames[n].innerHeight;
  18.     }else if(typeof ifr.documentElement != 'undefined' && typeof ifr.documentElement.clientWidth !='undefined' && ifr.documentElement.clientWidth != 0){
  19.         widthViewport=ifr.documentElement.clientWidth;
  20.         heightViewport=ifr.documentElement.clientHeight;
  21.     }else{
  22.         widthViewport= ifr.getElementsByTagName('body')[0].clientWidth;
  23.         heightViewport=ifr.getElementsByTagName('body')[0].clientHeight;
  24.     }
  25.     xScroll=window.frames[n].pageXOffset || (ifr.documentElement.scrollLeft+ifr.body.scrollLeft);
  26.     yScroll=window.frames[n].pageYOffset || (ifr.documentElement.scrollTop+ifr.body.scrollTop);
  27.     widthTotal=Math.max(ifr.documentElement.scrollWidth,ifr.body.scrollWidth,widthViewport);
  28.     heightTotal=Math.max(ifr.documentElement.scrollHeight,ifr.body.scrollHeight,heightViewport);
  29.     return [widthViewport,heightViewport,xScroll,yScroll,widthTotal,heightTotal];
  30.    
  31. }

y el tag del iframe debe ser algo así:

Código HTML:
Ver original
  1. <iframe name="principal" id="principal" src="main.html" frameborder="0" scrolling="no" onload="resizeIframe('principal','principal');"></iframe>

Espero te funcione y tmb espero no haber olvidado nada. Suerte!