views:

576

answers:

1

Hi

Does anyone know what's the replacement method for FB.CanvasClient.startTimerToSizeToContent() to resize iframe content in the new javascript SDK for Facebook?

Or maybe if there is an alternative technique for achieving the same effect?

Thanks

+1  A: 

Examples

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.Canvas.setAutoResize();
}

If you ever need to stop the timer, just pass false.

FB.Canvas.setAutoResize(false);

If you want the timer to run at a different interval, you can do that too.

FB.Canvas.setAutoResize(91);

Note: If there is only 1 parameter and it is a number, it is assumed to be the interval.

Parameters

Name      Type  Description
onOrOff   Boolean   Whether to turn the timer on or off. true == on, false == off. default is true
interval  Integer   How often to resize (in ms). default is 100ms
BeRecursive