/ Published in: JavaScript
Note: replace "USERNAME" with your own twitter username.
This is using cycle plugin with easing which is applied after the tweets are populated.
This is using cycle plugin with easing which is applied after the tweets are populated.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function getTwitter(){ var panel = $('#twitter_feed'); var tweet = ''; if( panel.length > 0 ) { $.ajax({ type : 'GET', dataType : 'jsonp', url : 'http://search.twitter.com/search.json?q=USERNAME', success : function(tweets) { $.each(tweets.results, function(i) { var created = tweets.results[i].created_at; var text = tweets.results[i].text; var href = 'http://twitter.com/USERNAME/status/'+tweets.results[i].id; var img = tweets.results[i].profile_image_url; tweet = '<span class="tweet"><img src="' + img + '" /><a href="' + href + '" rel="nofollow">' + text.substr(0, 45) + '..</a></span>'; panel.append(tweet); }); //let's do fade in effect $('#twitter_feed').cycle({ fx: 'scrollDown', speedIn: 2000, speedOut: 500, easeIn: 'easeOutBounce', easeOut: 'easeInBack', delay: 7000 }); }//end each });//end ajax }//end if }