Created
December 11, 2012 00:15
-
-
Save andershaig/4254593 to your computer and use it in GitHub Desktop.
Fix FB Comments for Mobile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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