I am having problem that I am developing a facebook app using iframe, the problem that is coming is that my full content is not being displayed . When I inspect it through firebug then I came to know that iframe is having height: 800px so I want to increase it or set height dynamically. I have tried FB.Canvas.setSize() but it didn't work so what should I do?
Full height of Facebook app Canvas in iframe
In the developer app on Facebook go to the app and edit settings. In the Facebook integration section you can set "IFrame size" to auto-resize. Then in your app, call FB.Canvas.setAutoResize after FB.init and the canvas should resize itself to fit your content automatically.
Yes you are right and I have now already fixed that, anyways thanks –
Nieberg
Just adding that the documentation suggests using
FB.Canvas.setAutoGrow
instead because FB.Canvas.setAutoGrow
is going to be removed. –
Tricyclic just go to your application settings change to auto resize
and use the function FB.Canvas.setAutoResize
as this code
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({
appId : 'your APP ID Goes Here',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true// parse XFBML
});
FB.Canvas.setAutoResize(7);
</script>
<?php
for($i=1;$i<100;$i++)
{
echo "$i<br>";
}
?>
this will make 99 lines with autoresize
You are welcome any way we found just a bug using this function developers.facebook.com/docs/reference/javascript/… you just try to put this function at the end of your page to be active –
Susi
© 2022 - 2024 — McMap. All rights reserved.