简体   繁体   中英

Remove facebook app scrollbars

I've tried several things but none seems to work.

this is my code:

window.fbAsyncInit = function() {
FB.init({
  appId      : '582678658430669',
});
FB.Canvas.setAutoGrow();
}

i also tried this:

FB.Canvas.setSize({ width: 800, height: 1000 });

but none of them is working. does facebook changed api?

this is the link for my app http://goo.gl/6veSG

In the Developer Tools in Chrome, switch the context of your console (see this question: Debugging iframes with Chrome developer tools ) and select your app/iframe (the name is starting with "app_runner..."). Once you've selected your iframe, run the following command:

d=[];jQuery("*").each(function () { width = $(this).outerWidth(true); if (width > 810) d.push({node: this, width: width}); }); console.log(d)

What it does is:

  1. Select all the elements of your page
  2. for each one, computing the width (including the margins, see outerWidth jQuery documentation ) and then if the element width is greater than the facebook iframe (810px), it's adding it to the array d .
  3. Inspect the array d and browse through all your elements.

(In your case, the issue is coming from the ul tag that is defined with a width: 100% and a margin-left: 140px )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM