为Facebook个人资料页面设置iframe标签的高度 [英] Setting the height of iframe Tabs for Facebook profile Pages

查看:74
本文介绍了为Facebook个人资料页面设置iframe标签的高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们知道Facebook已经引入了页面的iframe标签.我已经开发了一个应用程序,并在配置文件页面中添加了该应用程序的选项卡,根据更新页面的iframe选项卡",在iframe中打开了应用程序选项卡.问题在于页面的高度未调整,无法删除滚动条以显示没有滚动条的完整页面.我发现的所有解决方案都适用于应用程序"画布页面,而不适用于应用程序"选项卡页面.

As we know that Facebook has introduced iframe Tabs for Pages. I have developed an application and added the tab of the application in a profile page, application tab is opened in an iframe according to the update "iframe Tabs for Pages". The problem is that height of the page is not adjusted and unable to remove the scrollbars to display the fully page without scrollbars. All the solutions which I found work for the Application canvas page but not for the Application Tab page.

我们该怎么做?

推荐答案

这很容易实现.您必须在Facebook集成选项卡中将应用程序设置为 IFRAME ,框架的大小设置为自动调整大小".

It's quite easy to achieve. You have to set up the application in the Facebook Integration tab as an IFRAME and the size of the frame as "Auto-resize".

现在,在服务器上,您必须在</BODY>标记之前添加以下代码:

Now, on your server, you have to add the following code before the </BODY> tag:

<div id="fb-root"></div>
<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript" charset="utf-8">
    FB.Canvas.setSize();
</script>  

这将自动调整其大小.如果将 overflow:hidden 添加到BODY标签中,这也有帮助.

This will auto resize it. It also helps if you add overflow:hidden to the BODY tag.

这篇关于为Facebook个人资料页面设置iframe标签的高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆