Note: this method is only enabled when Canvas Height is set to "Fixed at (800)px" in the App Dashboard.
Starts or stops a timer which will grow your iframe to fit the content every few milliseconds. Default timeout is 100ms.
Used to be known as FB.Canvas.setAutoResize.
This function is useful if you know your content will change size, but you don't know when. There will be a slight delay, so if you know when your content changes size, you should call setSize yourself (and save your user's CPU cycles).
window.fbAsyncInit = function() {
FB.init({
appId : 'YOUR_APP_ID', // App ID
channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File
});
FB.Canvas.setAutoGrow();
}
If you ever need to stop the timer, just pass false.
FB.Canvas.setAutoGrow(false);
If you want the timer to run at a different interval, you can do that too.
FB.Canvas.setAutoGrow(91); // Paul's favourite number
Note: If there is only 1 parameter and it is a number, it is assumed to be the interval.
| Name | Type | Required | Description |
|---|---|---|---|
| onOrOff | Boolean | yes | Whether to turn the timer on or off. truthy == on, falsy == off. default is true |
| interval | Integer | yes | How often to resize (in ms). default is 100ms |