Skip to content

Instantly share code, notes, and snippets.

@WeiChiaChang
Created February 20, 2016 21:57
Show Gist options
  • Save WeiChiaChang/54017c614c980fc6e50b to your computer and use it in GitHub Desktop.
Save WeiChiaChang/54017c614c980fc6e50b to your computer and use it in GitHub Desktop.
<script>
<!--
$('#you').before("<iframe src='http://www.youtube.com/embed/y9tyxrg0rxg' id='ytplayer' type='text/html' width='100%' height='500' frameborder='0'/>");
var id = setInterval(function() {
$('#ytplayer').attr({
'width': '100%',
'height': '500'
});
setTimeout(function() {
if ($('#ytplayer').attr('width') == '100%')
clearInterval(id);
}, 2000);
}, 30);
-->
</script>
<div id="you"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment