Resizing Facebook iFrame app with new Javascript SDK

Does anyone know there is a replacement method for FB.CanvasClient.startTimerToSizeToContent () to resize iframe content in the new Facebook javascript SDK?

Or maybe if there is an alternative method to achieve the same effect?

thanks

+2


a source to share


1 answer


<strong> Examples

This feature 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 is resizing, you should call setSize yourself (and save the user's CPU cycles).

window.fbAsyncInit = function() {
  FB.Canvas.setAutoResize();
}

      

If you 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 as well.

FB.Canvas.setAutoResize(91);

      

Note: If there is only one parameter and this is a number, it is assumed to be an 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

      

+2


a source







All Articles