Skip to content

Instantly share code, notes, and snippets.

@freekrai
Created November 4, 2015 08:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save freekrai/f8fa4324937f3be8074b to your computer and use it in GitHub Desktop.
youtube embed
<div class="youtube" id="29MAL8pJImQ"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(function() {
return $('.youtube').each(function() {
var height, width;
width = 560;
height = 420;
return $(this).append("<iframe width=\"" + width + "\" height=\"" + height + "\" src=\"http://www.youtube.com/embed/" + this.id + "\" frameborder=\"0\" allowfullscreen></iframe>");
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment