1234567891011121314151617181920 |
- $(document).ready(function() {
-
- $('body').on("click",'img.youtube-embed-dummy-image',function(event) // Whenever an image with the class "youtube-embed-dummy-image" is clicked...
- {
-
- var image_that_was_clicked = $(this);
-
- var youtube_video_id = $(this).attr('id');
-
- $(this).fadeOut(250, function() {
- image_that_was_clicked.replaceWith('<iframe class="embedded_youtube_video" src="//www.youtube-nocookie.com/embed/' + youtube_video_id + '" frameborder="0" allowfullscreen></iframe>')
- });
- });
- })
|