从自定义粉丝页面选项卡中删除垂直滚动条确实很困难

发布于 2024-12-01 19:42:30 字数 181 浏览 2 评论 0原文

因此,我一直在互联网上寻找解决方案,以从我公司 Facebook 页面上的自定义选项卡页面中删除滚动条。当然,我不是程序员,昨天就弄清楚了如何构建这个东西,但我真的很想解决这个问题。 FB 应用程序开发人员似乎有很多针对旧格式的解决方案,但新版本却没有。\

我已经尝试实现一堆我发现的画布大小脚本,但要么没有,要么我的页面拒绝加载。

So I've been scouring the internet for solutions to remove the scroll bar from my custom tab page on my company's facebook page. Granted, I'm not programmer and figured out how to build this thing yesterday, but would really like fix to this. It seems like there are a ton of solutions to the old format the FB app developer but nothing with the new version.\

I've been attempted to implement a bunch of the canvas size scripts that I have found but either they don't or my page refuses to load.

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

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

发布评论

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

评论(4

梦行七里 2024-12-08 19:42:30

jsteid

这是我如何使用 OAuth 2.0 和新的 javascript sdk 调整选项卡大小的示例。
http://www.facebook.com/anotherfeed?sk=app_135669679827333

如果您使用由于框架中存在边距,因此设置的百分比需要低于 100%,大约为 98% - 96%。

<div id="fb-root"></div>
<script>
      window.fbAsyncInit = function() {
        FB.init({
    appId  : '135669679827333',
    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
        });
        //FB.Canvas.setAutoResize(); depreceated
            FB.Canvas.setAutoGrow(1000);
      };
      (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>

jsteid

Here is a sample of how i resize my tabs using OAuth 2.0 and new javascript sdk.
http://www.facebook.com/anotherfeed?sk=app_135669679827333

If you are using % to set with they need to be under 100% at about 98% - 96% because of a margin in the frame.

<div id="fb-root"></div>
<script>
      window.fbAsyncInit = function() {
        FB.init({
    appId  : '135669679827333',
    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
        });
        //FB.Canvas.setAutoResize(); depreceated
            FB.Canvas.setAutoGrow(1000);
      };
      (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-08 19:42:30

要解决高度问题,请加载js sdk并设置画布尺寸

<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
  FB.init({
    appId  : '123456789',
    status : false, // check login status
    cookie : false, // enable cookies to allow the server to access the session
    xfbml  : false  // parse XFBML
  });

  FB.Canvas.setSize({ width: 500, height: 1000 });
</script>

测试,看看什么值适合您的需要

to fix the height issue, load the js sdk and set the canvas size

<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
  FB.init({
    appId  : '123456789',
    status : false, // check login status
    cookie : false, // enable cookies to allow the server to access the session
    xfbml  : false  // parse XFBML
  });

  FB.Canvas.setSize({ width: 500, height: 1000 });
</script>

test and see what values fit your need

与之呼应 2024-12-08 19:42:30

我认为 iframe 选项卡上 FB.Canvas 的大小方法存在错误。高度设置正确,但滚动仍然存在。在我的情况下,唯一的解决方法是 FB.Canvas.SetAutoResize() + 样式“body”与溢出:隐藏的组合。

I think there is a bug with FB.Canvas's size methods on iframe tabs. Height is set properly but scrolls are still there. Only workaround in my case is combination of FB.Canvas.SetAutoResize() + styling 'body' with overflow: hidden.

残月升风 2024-12-08 19:42:30

您需要执行以下操作:

  1. 转到您的应用 (https://developers.facebook.com/apps/)

  2. < p>在相关应用上点击“编辑设置”。

  3. 转到:设置 ->高级->画布设置->画布高度 ->选择“自动调整大小”。

如果您仍然遇到问题,这里的其他建议应该可以通过执行类似的操作来帮助您...

<div id="fb-root"></div>
<script type="text/javascript"> 
  window.fbAsyncInit = function() {
    FB.init({appId: '12345', status: true, cookie: true, xfbml: true});
  window.setTimeout(function() {
    FB.Canvas.setAutoResize();
  }, 1000);
  };
  (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>

这里我将页面高度设置为 1000 ->将其更改为您的页面高度,我将您的应用程序 ID 设置为 12345 ->将其更改为您的应用程序 ID。

我希望这对你有用。

You need to do this:

  1. Go to your app (https://developers.facebook.com/apps/)

  2. Click 'Edit Settings' on the app in question.

  3. Go to: Settings -> Advanced -> Canvas Settings -> Canvas Height -> select 'Auto-Resize'.

If you still get problems the other suggestions here should help by doing something like...

<div id="fb-root"></div>
<script type="text/javascript"> 
  window.fbAsyncInit = function() {
    FB.init({appId: '12345', status: true, cookie: true, xfbml: true});
  window.setTimeout(function() {
    FB.Canvas.setAutoResize();
  }, 1000);
  };
  (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>

Here I set your page height to 1000 -> change this to your page height and I set your app ID to 12345 -> change this to your app id.

I hope this works for you.

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