One of the best things to happen in Facebook development lately was to enable iframe application tabs. This was widely welcomed by developers. However many blog posts wrongly assumed there was a 800 pixel limit on the tab height. Behold, here is the 5000 pixel tab.

New Tab is iFrame Canvas Application New tab works the same way as iframe canvas application. First load the JavaScript SDK. Easiest is to load it synchronously using a script tag (for production you want to load SDK asynchronously since it gives impression of faster loading page).

<script type="text/javascript" src=""></script>
<script type="text/javascript" charset="utf-8">
    /* Resizing code will be here. */

When JavaScript SDK is loaded you have access to FB.Canvas.setSize and FB.Canvas.setAutoResize methods. If you know the content size wont change later resize the frame only once when page loads.


You can also pass the desired size as parameter.

FB.Canvas.setSize({ width: 520, height: 600 });

If content is dynamic and size might change tell Facebook to resize the iframe periodically.


Default is to try resizing every 100ms. If you want to force resizing more often you can pass desired interval as parameter.


Is There a Maximum Limit? Quick search on Google did not reveal any browser limitation. Theoretically on 32 bit machines maximum page length would be 4 294 967 295 pixels . On 64 bit machines theoretical limit would be 8 446 744 073 709 551 615 pixels. Now I’m sure real limit is smaller but the bottom line is: there is enough pixels for marketers to create their next Facebook campaign…

創作者 shadow 的頭像


shadow 發表在 痞客邦 留言(0) 人氣()