Created
June 14, 2012 11:24
-
-
Save JackuB/2929733 to your computer and use it in GitHub Desktop.
Youtube video to div
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
<div id="video_container"></div> | |
<a href="bMvRdr-mUOU" class="vid_trigger"> | |
<script type="text/javascript"> | |
$('.vid_trigger').click( function(e){ | |
e.preventDefault(); | |
var URL = $(this).attr('href'); | |
var htm = '<iframe width="615" height="460" src="http://www.youtube.com/embed/' + URL + '?autoplay=1&wmode=transparent" frameborder="0" allowfullscreen ></iframe>'; | |
$('#video_container').html(htm); | |
return false; | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi
I have tested this on an Ipad and it will only change a video if one is playing otherwise no response from links.