Last active
March 26, 2016 10:34
-
-
Save maltefiala/e40f0e0c28a163e80d7a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// requires jQuery | |
$(function clickToActivate() { | |
$(".videoplaceholder" ).click(function() { | |
var videourl = $( this ).attr( "videourl" ); | |
$( this ).replaceWith( '<iframe src="' + videourl + '" frameborder="0"></iframe>' ); | |
}); | |
}); | |
// CODE FOR CSS | |
// .videoplaceholder { | |
// cursor: pointer; | |
// } | |
// HTML EMBED | |
// <div class="videoplaceholder" videourl=<VIDEO URL>"> | |
// <img src="<IMAGE URL>" /> | |
// </div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Rewrote it, DRY