Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <div id="tweets"></div>
  <script src="https://code.jquery.com/jquery-1.11.3.js"></script>
  <script src="https://platform.twitter.com/widgets.js"></script>
</body>
</html>
 
#tweets {
    margin: 10px auto 0;
    max-width: 820px;
    width: 95%;
}
#tweets .row {
    overflow: hidden;
}
#tweets .row > .tweet {
    max-width: 520px;
    width: 49%;
}
#tweets .row > .tweet:nth-child(1) {
    float: left;
}
#tweets .row > .tweet:nth-child(2) {
    float: right;
}
#tweets .row > .tweet .twitter-tweet-rendered {
    max-width: 100% !important;
    width: 100% !important;
}
 
window.onload = (function(){
    var tweets = [
      '629488522752212992', '629487749200936961','629488522752212992', 
      '629487749200936961','629488522752212992', '629487749200936961'];
    var container = $('#tweets');
    var list = '';
    // build the necessary markup before rendering tweets
    for (var i = 0, even = true; i < tweets.length; i++, even = i % 2 === 0) {
        if (even) {
          list += '<div class="row">';
        }
        list += '<div class="tweet"></div>';
        if (!even) {
            list += '</div>';
        }
    }
    container.html(list);
    // render tweets 
    $.each(tweets, function (i) {
      var tweet = container.find('.tweet:eq(' + i + ')')[0];
      twttr.widgets.createTweet(this, tweet, { 'cards': 'none' });
    });
});
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers