Iframe height for Facebook page

Facebook's iframe page has a maximum height of 800 pixels. Are there any options for changing it? I saw several pages / applications that are deeper than 800px

+4
source share
4 answers

This note provides instructions on how to do this. Set application parameters for automatic resizing: enter image description here

Then call FB.Canvas.setSize () or FB.setAutoResize () to remove the scroll bars if they still appear.

+3
source

Try this to the end of your iframe content:

<div id="fb-root"></div> <script type="text/javascript"> window.fbAsyncInit = function() { //Der folgende Code ändert die Grösse des iFrames alle 100ms FB.Canvas.setAutoResize(100); }; (function() { var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; document.getElementById('fb-root').appendChild(e); }()); </script> 
+1
source

Andrew Smart: I was able to replicate your error here according to page height.

Using my apps for pages @ http://www.facebook.com/anotherfeed?sk=app_135669679827333

I used javascript to calculate the height of the inner page for 7 seconds "7000ms" after the page was loaded to avoid errors. At the bottom of the tab of the page tab you will see ...

This page took 1.724007 seconds. W: 520 x H: 800 , where the actual iframe is 5704 pixels high.

 <iframe name="app_runner_4e581c03cfc387e71622269" id="app_runner_4e581c03cfc387e71622269" style="width: 520px; height: 5704px; " frameborder="0" src="http://static.ak.facebook.com/platform/page_proxy.php?v=4#app_runner_4e581c03cfc387e71622269"></iframe> 

It seems that the page returned 800 pixels as the height, no matter how long the page takes, I believe that this is an error in the page_proxy.php file and the error can be sent to bugzilla.

Code i used for page height:

 <div id="pagestats"></div> <script> <!-- Hide from non-JS browsers var scnWid,scnHei; if (self.innerHeight) // all except Explorer { scnWid = self.innerWidth; scnHei = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode { scnWid = document.documentElement.clientWidth; scnHei = document.documentElement.clientHeight; } else if (document.body) // other Explorers { scnWid = document.body.clientWidth; scnHei = document.body.clientHeight; } setTimeout("document.getElementById('pagestats').innerHTML='W:'+scnWid+' x H:'+scnHei+'';",7000); // --> </script> 
0
source
 <script type="text/javascript"> window.fbAsyncInit = function() { FB.init({ appId: 'APP_ID', status: false, cookie: true, xfbml: true }); FB.XFBML.parse(); FB.Canvas.setSize({ width: '520px', height: '1580px' }); FB.Canvas.scrollTo(0,0); }; (function(d){ var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;} js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en_US/all.js"; d.getElementsByTagName('head')[0].appendChild(js); }(document)); </script> 
0
source

Source: https://habr.com/ru/post/1369222/


All Articles