mjcoder
mjcoder

Reputation: 1011

Facebook App Canvas Resize

Im trying to resize the canvas app iFrame size - it lets me adjust the height but not the width, the width is always set to 520px and height to 900px;

The documentation shows how you can set the canvas app settings through the developer apps but the settings are not there for me, how weird. I've tried autoResize, autoGrow and other options, running out of ideas here now.

This is the code that i am using;

<div id="fb-root"></div>
<script src="https://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({
    appId: 'my_app_id',
    status: true, // check login status
    cookie: true, // enable cookies to allow the server to access the session
    xfbml: true // parse XFBML
});    
</script>
<script type="text/javascript">
window.fbAsyncInit = function () {
    FB.Canvas.setAutoResize(true);
}
</script>

Upvotes: 1

Views: 1664

Answers (4)

mjcoder
mjcoder

Reputation: 1011

Under Advanced settings there is radio buttons for MIGRATIONS playing around with those solved the problem and setting the default width of 810px and height to 900px works fine - however i've got the scrollbar at the bottom. Dont think there is a way of moving that - but finally im getting somewhere - the canvas settings are not there anymore for the admin of the app or developers. Strange!

Upvotes: 0

mjcoder
mjcoder

Reputation: 1011

if your the developer of the app can you not set the canvas settings through the app dashboard, do you have to be the admin of the app? Because i cant see the canvas app settings when i go on "Advanced"

Upvotes: 0

Needhi Agrawal
Needhi Agrawal

Reputation: 1326

Try this:
1.Go to the link
https://developers.facebook.com/apps
2.Select your app
3.click on edit app
4.click on advance setting
5.change canvas size setting as you wish

You can select width as fixed or fluid and height as fluid or as you wish according to height width is resized.

Upvotes: 1

Needhi Agrawal
Needhi Agrawal

Reputation: 1326

Try the following function by providing explicit width and height:

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

To see more - https://developers.facebook.com/docs/reference/javascript/FB.Canvas.setSize/

Upvotes: 1

Related Questions