Skip to content

Instantly share code, notes, and snippets.

@andershaig
Created December 11, 2012 00:15
Show Gist options
  • Save andershaig/4254593 to your computer and use it in GitHub Desktop.
Save andershaig/4254593 to your computer and use it in GitHub Desktop.
Fix FB Comments for Mobile
// setup comments for mobile width
var w = screen.availWidth;
w = w < 320 ? 320:w;
if((typeof window.orientation) == 'number' && w <= 480) {
$(document.getElementsByTagName('fb:comments')).add('.fb-comments').each(function () {
this.setAttribute('width', w);
this.setAttribute('data-width', w);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment