A
A
Andrey Filimonov2017-02-20 01:47:11
JavaScript
Andrey Filimonov, 2017-02-20 01:47:11

How to stretch the new (2017) facebook widget to the full width of the container?

Hello, on Facebook for developers I create a page plugin for the site, I check the box "Adapt to the width of the plugin container" gives the following codes:

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/ru_RU/sdk.js#xfbml=1&version=v2.8";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

and
<div class="fb-page" data-href="https://www.facebook.com/gymandbalance" data-height="160" data-small-header="true" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true"><blockquote cite="https://www.facebook.com/gymandbalance" class="fb-xfbml-parse-ignore"><a href="https://www.facebook.com/gymandbalance">Balance</a></blockquote></div>

But the widget is not full width. How to do it all? data-width="auto" and data-width="100%" don't help.
There are tips, but they are either outdated, or I'm doing it wrong. Here's one . On the toaster, there are examples of how VK and OK widgets were stretched. How to stretch facebook widget?
I try here

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Filimonov, 2017-02-20
@fil_and

Here is what facebook replied:

Hi Andrew,
Please try to add data-width="500" while still keeping the data-adapt-container-width="true"
Also note that the plugin's max width is 500px, so if your container is wider than 500px, it will not fit the whole container. But if it is smaller than 500px, it will fit in the container.
Best,
Gunay

so here. maybe you can go around and stretch wider than 500 px?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question