bro*_*nts 5 iframe height facebook
我知道这个主题已被多次询问和回答,但请相信我花了很多时间寻找有用的帮助和答案,并且/或者我可以理解.
这是同一个问题:我已经想出了如何为它添加一个自定义选项卡甚至是一个自定义图标(我很高兴能够做到这一点!).但是,根据许多其他的求助请求,它有可怕的滚动条.我和其他人一样,希望它能够超过800px的有限尺寸.我有几个不同的修复方法,有些我尝试过不成功,有些只是我的头脑,我不明白什么是写的,它去哪里以及需要在其中编辑什么.
我真的很感谢有人花时间带我完成整个过程并解释了什么以及如何取悦.
查看页面:http://www.bronts.com/bronts_facebook/index.html
在facebook中查看页面:http://www.facebook.com/pages/brontscom/191839754181703
您需要使用javascript sdk在pagetab应用程序中自动调整iframe.您需要有一个应用程序ID.请参阅https://developers.facebook.com/docs/reference/javascript/
FB.Canvas.setAutoResize(); 设置画布的高度.
这是我的应用程序的工作示例.http://www.facebook.com/apps/application.php?id=135669679827333&sk=app_135669679827333
注意:setAutoResize(); 将改为setAutoGrow();
另外:您可能需要缩小图像的宽度,在确定自动尺寸之前不确定.
----------我使用它并添加到我的文档的<body>标签下面.
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'Your-App-Id-Here',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true, // parse XFBML
//channelUrl : 'http://WWW.MYDOMAIN.COM/channel.html', // channel.html file
oauth : true // enable OAuth 2.0
});
/* sets auto size to app canvas and page tab app. */
FB.Canvas.setAutoResize();
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1475 次 |
| 最近记录: |