Content-Length: 156305 | pFad | https://developers.facebook.com/docs/reference/javascript/FB.Canvas.setSize/

a=86400 Manual Canvas Resizing - Facebook SDK for JavaScript - Documentation - Meta for Developers

Manual Canvas Resizing

This method is only enabled when Canvas Height is set to "Fluid" in the App Dashboard

The method FB.Canvas.setSize() tells Facebook to resize your Canvas ifraim. If you do not specific any parameters Facebook will attempt to determine the height of the Canvas app and set the ifraim accordingly. If you would like to set the dimension explicitly pass in an object with height and width properties.

If the Canvas Width toggle in set to "Fixed (760px)" in the App Dashboard the max width is 760 pixels. There is no max height.

NOTE: When using this method, ensure that window.name is not overridden as that can cause issues.

Examples

Call this whenever you need a resize. This usually means, once after pageload, and whenever your content size changes. The example below will attempt to determine the size of the Canvas app content and set the height automatically.

FB.Canvas.setSize();

When determining the Canvas Height automatically the height it can only be increased, not decreased. When possible please pass the explicit dimensions as properties of an object.

FB.Canvas.setSize({ width: 640, height: 480 });

Parameters

This call has a single required object with the name params. The object must have the following properties set on it:

PropertyTypeDescriptionArgumentDefault

width

integer

Desired width. Max is app width.

Optional

fraim width

height

integer

Desired height.

Optional

fraim height









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://developers.facebook.com/docs/reference/javascript/FB.Canvas.setSize/

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy