您可以尝试使用FB.Canvas.setAutoResize()。它将摆脱水平和垂直滚动条。
请参考下面的代码片段:
<body onload="sizeChangeCallback()">
<div id="fb-root">
</div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId: 'YOUR APP ID',
status: true, // check login status
cookie: true, // enable cookies to allow the server to access the session
xfbml: true, // parse XFBML
oauth: true
});
FB.Canvas.setAutoResize(); //set size according to iframe content size
};
(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
function sizeChangeCallback() {
FB.Canvas.setAutoResize();
}
</script>
如果滚动条仍然存在,你定身的溢出风格为隐藏。
EX:<body style="overflow: hidden; onload="sizeChangeCallback()"></body>
我只是做了那些改变。我也尝试过最大宽度:520px;似乎只有一件事情是设置溢出:隐藏;但后来它切断了文字的底部也... – 2012-01-12 22:45:34
http://spelloveryou.com/facebook-iframe-apps-getting-rid-of-those-scrollbars/ 这是修复... – 2012-01-12 23:15:12