Facebook Canvas 应用程序 iFrame 大小显示滚动条问题
我在 ASP.net 应用程序中使用 Facebook C# SDK。 我有一个 iFrame 应用程序,其 iFrame Size 设置为 Showscrollbars。 该应用程序直到昨天都工作正常,但今天 iFrame 没有拉伸到其宽度(根据文档 Facebook 的 iFrame 宽度为 760px 链接此处)。我的应用程序中的页面宽度设置为 95%。所以我认为这不是我的应用程序中的宽度问题。 。 我必须为我的应用程序使用 Showscrollbars 选项。 facebook 是否更改了 iFrame 应用程序的任何设置?请帮忙。
更新 看起来 facebook 破坏了某些东西或者他们正在尝试摆脱滚动条选项。我必须更改我的应用程序以使用 AutoResize 选项。我对我的 asp.net 应用程序进行了以下更改,除了一个问题(请参阅问题底部)
<head runat="server">
<title></title>
<script type="text/javascript">
window.fbAsyncInit = function () {
FB.Canvas.setAutoResize();
};
</script>
</head>
<body>
<div id="fb-root"></div>
<script src="//connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({
appId: '12345678', //replace with your facebook appid
cookie: true,
status: true,
xfbml: true
});
</script>
</body>
当内容增加时 iFrame 会垂直拉伸外,它工作正常。这很酷但是 问题是在 StackOverflow 上阅读此处< /a>.我正在努力。如果有人弄清楚请告诉我。
I am using Facebook C# SDK in my ASP.net application.
I have an iFrame application whose iFrame Size set to Showscrollbars.
The application was working fine till yesterday, but today the iFrame is not stretching to its width (From the documentation Facebook's iFrame width is 760px Link here). The page in my application's width is set to 95%. So I think its not a width problem in my application.
.
I have to use Showscrollbars option for my application.
Did facebook Changed any settings for the iFrame Apps? Help please.
UPDATE Looks like facebook broke something or they are trying to get rid of scrollbar options. I have to change my application to use AutoResize Option. I made the following changes to my asp.net application and it is working fine except one issue (see at the bottom of the question)
<head runat="server">
<title></title>
<script type="text/javascript">
window.fbAsyncInit = function () {
FB.Canvas.setAutoResize();
};
</script>
</head>
<body>
<div id="fb-root"></div>
<script src="//connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({
appId: '12345678', //replace with your facebook appid
cookie: true,
status: true,
xfbml: true
});
</script>
</body>
iFrame stretches vertically when the content increases. That's cool but the
ISSUE is Read Here on StackOverflow. I am working on it. If any one figures it out please let me know.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
中使用这个简单的 CSS 修复了它,
我遇到了同样的问题,并在 iFrame 页面主体 {overflow:hidden;}
一切仍然很好,没有任何内容被切断。只是摆脱那些讨厌的滚动条!
这听起来确实像是一个错误,在除 FF 3.6 之外的所有其他浏览器中都运行良好
添加上述内容还有一个优点,即不会在加载时暂时显示滚动条。
I had the same problem and fixed it with this simple bit of CSS in the iFrame page
body {overflow:hidden;}
everything still fits nicely, with nothing cut off. just gets rid of those pesky scrollbars!
it certainly sounds like a bug, worked fine in all other browsers but FF 3.6
adding the above also has the advantage of not having the srollbars momentarily show on load.
使用下面的代码,它适用于我的所有 iframe 应用程序:)
Use code below and it's works on all of my iframe apps :)