I\'m developing a site around the \"responsive design\" concept, but the facebook social plugins are static width and \"break\" the layout when it\'s re-sized.
Using
Joining the uninformed masses with my own solution to this problem, as of September, 2015:
Facebook provides an option to the fb-page widget called adapt-container-width, which (according to the docs,) should track the parent's width (up to a maximum width of 500px). When rerendering with FB.XFBML.parse(), the widget seems to get stuck on a strange value for the parent's container width, despite what you set on the actual widget itself. For now, this works well enough:
window's resize method, (optionally using _.debounce with a sensible limit to prevent overloading the browser with the intermediate requestsWait for Facebook to expose more of the widget API so we can see what the hell is going on
data-href="https://www.facebook.com/yourpage"
data-show-posts="true"
data-small-header="true"
data-width="100%"
>
combined with the following javascript:
// FB Resize
$(window).bind('resize', _.debounce(function() {
if (window.FB && FB.XFBML && FB.XFBML.parse) {
var el = $('.fb-page');
var width = el.parent().width();
el.attr('data-width', width);
FB.XFBML.parse();
}
}, 1000)); // Debounce until 1000ms have passed