Skip to content

Instantly share code, notes, and snippets.

@cedmond
Last active August 29, 2015 13:57
Show Gist options
  • Save cedmond/9808601 to your computer and use it in GitHub Desktop.
Save cedmond/9808601 to your computer and use it in GitHub Desktop.
Check for facebook posts loaded in a widget, truncate them and add an epllipsis.
var fbCheck = setInterval(function(){
var fbPosts = $j('li.facebook');
if( fbPosts.length > 0 ){
fbPosts.each(function() {
var $this = $j(this);
$this.text( $this.text().slice(0,150) );
$this.append(' …');
});
clearInterval(fbCheck);
}
},100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment