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

瘦欲@ 提交于 2019-12-04 12:08:42

问题


What is the maximum iframe width of a facebook page?


回答1:


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.




回答2:


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>



回答3:


For future reference, you can set the frame width to be floating inside advanced settings of app. This allows you to have any width for your app. See http://developers.facebook.com/blog/post/549/



来源:https://stackoverflow.com/questions/6828293/what-is-the-maximum-iframe-width-of-a-facebook-page-july-2011

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!