iframe高度问题

发布于 2024-12-07 10:49:16 字数 600 浏览 1 评论 0原文

我知道这个话题已经被多次询问和回答,但请相信我花了很多时间寻找有效的和/或我真正能理解的帮助和答案。

这是同样的问题: 我已经弄清楚如何添加自定义选项卡,甚至为其添加自定义图标(我真的很高兴能够做到这一点!)。 但是,正如许多其他的帮助请求一样,它有可怕的滚动条。 我和其他人一样,希望它能够向下流动超过其有限的 800 像素大小。 我对此有几种不同的修复方法,有些我尝试过但没有成功,有些则超出了我的想象,我根本不明白正在写什么,它去了哪里以及需要在其中编辑什么。

我真的很感激有人花时间引导我完成整个过程并解释什么以及如何做。

在此处查看页面:http://www.bronts.com/bronts_facebook/index.html

在此处查看 facebook 内的页面:http://www.facebook.com/pages/brontscom/191839754181703

I know this topic has been asked about and answered multiple times but please believe that I have spend many hours searching for help and answers that work and/or I can actually understand.

It's the same ol' issue:
I have figured out how to add a custom tab and even a custom icon for it (and I am really happy to have been able to do even that!).
But, as per many other requests for help, it has the dreaded scroll bars.
I, like the others, want it to flow down past it's limited 800px size.
I have several different fixes for this, some I have tried unsuccessfully and some just go right over my head and I do not understand what is being written at all, where it goes and what needs to be edited in it.

I would really appreciate someone taking the time to walk me through the process and explaining the what's and how to's please.

View page here: http://www.bronts.com/bronts_facebook/index.html

View page within facebook here: http://www.facebook.com/pages/brontscom/191839754181703

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

冧九 2024-12-14 10:49:16

您将需要使用 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();

另外:您可能需要减小图像的宽度,直到自动调整尺寸到位后才能确定。

---------- 我使用这个并添加到 <<身体>我的文档的标签。

      <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>

You will need to use javascript sdk to autosize the iframe in a pagetab app. You will need to have an application id for this. Refer to https://developers.facebook.com/docs/reference/javascript/

the FB.Canvas.setAutoResize(); sets the height of the canvas.

here is working example on my app. http://www.facebook.com/apps/application.php?id=135669679827333&sk=app_135669679827333

NOTE: setAutoResize(); will be changing to setAutoGrow();

ALSO: you may need to reduce the width of your image, not sure until auto size is in place.

---------- i use this and add just below the < body > tags of my documents.

      <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>
小鸟爱天空丶 2024-12-14 10:49:16

overflow:hidden; 添加到 body 并使用 jQuery.ScrollTo 在 iframe 内导航。

Add overflow: hidden; to your body and use jQuery.ScrollTo to navigate inside iframe.

攀登最高峰 2024-12-14 10:49:16
<script src="https://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript" charset="utf-8">
window.fbAsyncInit = function() 
{
    FB.init({ appId: '1375268019431848', 
    status: true, 
    cookie: true,
    xfbml: true,
    oauth: true});

    FB.Canvas.setAutoGrow();
    FB.Canvas.setAutoResize();
}
</script>
<script src="https://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript" charset="utf-8">
window.fbAsyncInit = function() 
{
    FB.init({ appId: '1375268019431848', 
    status: true, 
    cookie: true,
    xfbml: true,
    oauth: true});

    FB.Canvas.setAutoGrow();
    FB.Canvas.setAutoResize();
}
</script>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文