Facebook iFrame 垂直滚动条不会消失
我使用之前使用过 3 次的相同模板创建了一个自定义 Facebook 登陆页面。问题是,这一次,垂直滚动条不会消失。这是我一直在使用的调整大小代码:
<script type="text/javascript">// <![CDATA[
window.fbAsyncInit = function() { FB.Canvas.setSize({ width: 520, height: 1200});}
function sizeChangeCallback() { FB.Canvas.setSize({ width: 520, height: 1200});}
// ]]></script>
在页面底部:
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js" type="text/javascript"></script>
<script type="text/javascript">// <![CDATA[
FB.init({
appId : 'MY_APP_ID',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
// ]]></script>
我的 CSS 使用 body {overflow: hide;}
,在我的应用程序中选择了“自动调整大小”。问题不在于 ifarme 不会调整大小(确实如此),而是我右侧有一个空的垂直滚动条,不会消失。
由于 iframe 设计使用整个 520px 宽度,空的垂直滚动条给了我可怕的水平滚动条。从水平滚动条的宽度来看,是垂直滚动条导致的,而不是 HTML/CSS 中的任何内容(我可以找到或看到)使页面宽度超过 520px。该问题发生在 IE8、IE7 和 Firefox 中。
您可以在此处查看该页面。
我尝试了来自几个不同来源的 JavaScript 代码的一些变体,但没有成功。不确定这是否是我遗漏的小东西,或者是否是另一个 Facebook 错误。我的其他任何 facebook iframe 登陆页面上都不存在这个问题。在四处寻找答案但一无所获之后,我在这个问题上碰壁了。
I created a custom facebook landing page using the same template I have used 3 times before. The problem is, this time, ther vertical scrollbar won't go away. This is the resizing code I have been using:
<script type="text/javascript">// <![CDATA[
window.fbAsyncInit = function() { FB.Canvas.setSize({ width: 520, height: 1200});}
function sizeChangeCallback() { FB.Canvas.setSize({ width: 520, height: 1200});}
// ]]></script>
and at the bottom of the page:
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js" type="text/javascript"></script>
<script type="text/javascript">// <![CDATA[
FB.init({
appId : 'MY_APP_ID',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
// ]]></script>
My CSS uses body {overflow: hidden;}
, inside my app "auto resize" is selected. The issue is not that the ifarme won't resize (it does), it's that I have an empty vertical scrollbar on the right that won't go away.
Since the iframe design uses the whole 520px width, the empty vertical srollbar gives me the dreaded horizontal scrollbar. Judging by the width of the horizontal scrollbar, it's the vertical scrollbar causing it and not anything (that I can find or see) in the HTML/CSS making the page wider than 520px. The problem happens in IE8, IE7 and Firefox.
You can see the page here.
I have tried a few variations of the javascript code from a few different sources, but no luck. Not sure if this is something small I'm missing or if it's yet another facebook bug. This problem is not present on any of my other facebook iframe landing pages. After searching around for an answer and coming up with nothing, I've hit a wall with this one.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
style.css 样式表中的这段代码
导致了问题。当我用 Chrome 检查它并删除该值时,滚动条消失了。
Its this code
in your style.css style sheet thats causing the problem. When I inspect it with Chrome and remove that value, the scroll bars disappear.