Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the maximum iframe width of a facebook page? (July 2011)

What is the maximum iframe width of a facebook page?

like image 831
Tomkay Avatar asked Jul 26 '11 09:07

Tomkay


2 Answers

It was 520px.

As with a Canvas Page, the amount of space available to your app is bounded by the outer context of Facebook. Since your app is also loaded inside of Facebook Page, the space is smaller (520 pixels) than what is available to on a Canvas Page.

from FB docs (yes i know that doc about canvas and it's only mentions iframes, but i cannot find quickly reference to full iframe documentation)

Important Update

On the March 30th 2012, Facebook changed this to 810px, to match the new design of timeline.

And here you have a screenshot of the Facebook app, with width 810px.

enter image description here

like image 171
Igor Milla Avatar answered Sep 22 '22 17:09

Igor Milla


It's 810 px wide. You don't have to worry about scrollbars if you use the following code...

<!--in head section-->
<script type="text/javascript">    
  window.fbAsyncInit = function() {    
    FB.Canvas.setSize();    
  }    
  // Do things that will sometimes call sizeChangeCallback()    
  function sizeChangeCallback() {    
    FB.Canvas.setSize();    
  }    
</script>

<!--at the bottom of your page right before the closing body tag-->

<div id="fb-root"></div>

<script src="http://connect.facebook.net/en_US/all.js"></script>

<script>    
  FB.init({    
    appId : '320332891360172',    
    status : true, // check login status  
    cookie : true, // this allow the server to access the session  
    xfbml : true // parse XFBML    
  });    
</script>
like image 21
user1142121 Avatar answered Sep 26 '22 17:09

user1142121