From my research it seems as if this is a re-occuring problem. I’m using the following code to resize the iframe, it currently works… that is it resizes the iframe to fit larger content, however it won’t shrink back again!
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
/* Init fb Resize window */
FB.Canvas.setAutoResize(7);
FB.init({
appId:'<?php echo Yii::app()->params['fbAppId']; ?>',
status: true,
cookie: true,
xfbml: true
});
};
</script>
The code is positioned at the very end of the html file, before the closing body tag.
It is not logical to call FB.Canvas.setAutoResize(7); before you call FB.init()
Also you should not call FB.Canvas.setAutoResize(7); in window.fbAsyncInit
Here is a proper example
Using jQuery. This way you can be sure that the page is resized when DOM is loaded, not before that. This way you can place your code anywhere on the page.
You set FB.Canvas.setAutoResize to 700 ms. Do you have any particular reason to do so ? The default value is 100ms