Skip to content

Instantly share code, notes, and snippets.

@mbilski
Created March 3, 2016 17:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbilski/cfbb9c60b92f9ef4b1af to your computer and use it in GitHub Desktop.
Save mbilski/cfbb9c60b92f9ef4b1af to your computer and use it in GitHub Desktop.
$(document).ready(function() {
window.twttr = (function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0], t = window.twttr || {};
if (d.getElementById(id)) return t;
js = d.createElement(s);
js.id = id;
js.src = "https://platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js, fjs);
t._e = [];
t.ready = function(f) {
t._e.push(f);
};
return t;
}(document, "script", "twitter-wjs"));
twttr.ready(function(twttr) {
$(".tweet").each(function() {
twttr.widgets.createTweet($(this).data("id"), $(this)[0], {cards: "hidden"}).then(function(el) {
$(el).contents().find('.EmbeddedTweet').css('max-width', '800px');
});
});
});
});
<div class="tweet" data-id="705128887810965504"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment