is there any way how to auto resize the iframe(canvas) to show all my content? I don't want the scrollbar. I tried every JS method and nothing worked.
Asked
Active
Viewed 1,276 times
3 Answers
0
Or...
jQuery(window).load(function(){
FB.Canvas.setSize();
});
Wait till everything has loaded then reset the size.
![](../../users/profiles/1156334.webp)
DanV
- 2,874
- 3
- 25
- 39
0
I use this code and it works for all content height's, even when I need to decreased it:
window.fbAsyncInit = function() {
FB.init({
appId : 'YOUR_APP_ID',
status : true,
cookie : true,
xfbml : true,
oauth: true
});
FB.Canvas.setSize({height:600});
setTimeout("FB.Canvas.setAutoGrow()",500);
};
![](../../users/profiles/1342638.webp)
red_alert
- 1,728
- 14
- 23
0
It's possible but it's quite tedious. See this answer here: Resizing an iframe based on content
![](../../users/profiles/-1.webp)
Community
- 1
- 1
![](../../users/profiles/627569.webp)
citizen conn
- 15,011
- 3
- 54
- 78
-
Thanks, but the topic is almost 3 yrs old. There must be some another solution (I would rather shoot myself in my leg than implement this code). – Ginnyous Jul 14 '11 at 22:42
-
It still applies, cross domain scripting is a security constraint which is there for a reason. – citizen conn Jul 14 '11 at 23:00
-
1I find [the solution!](http://forum.developers.facebook.net/viewtopic.php?id=91458) – Ginnyous Jul 14 '11 at 23:23
-
awesome! Good to know. You can answer your own question too : ) – citizen conn Jul 14 '11 at 23:29