i did a popup with youtube video at page load.
I need that the popup close when the video finish...is it possible to integrate this script?
This is the code:
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="jquery.fancybox-1.3.1.js"></script>
<link rel="stylesheet" type="text/css" href="jquery.fancybox-1.3.1.css" media="screen" />
<script type="text/javascript">
$(document).ready(function() {
$("#yt").click(function() {
$.fancybox({
'padding' : 0,
'autoScale' : false,
'transitionIn' : 'none',
'transitionOut' : 'none',
'title' : this.title,
'width' : 880,
'height' : 595,
'href' : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
'type' : 'swf',
'swf' : {
'wmode' : 'transparent',
'allowfullscreen' : 'true'
}
});
return false;
});
});
$('#foo').bind('click', function() {
alert($(this).text());
});
$('#foo').trigger('click');
</script>
</head>
<body onload='$("#yt").trigger("click");'>
<h1>fancybox example</h1>
<p><a id="yt" title="" href="https://www.youtube.com/watch? v=y0vh14W4iTM&fs=1&autoplay=1"></a></p>
I report this discussion.
FancyBox and Youtube API events
I've not practice with javascript someone can help me?