javascript - How do you make a div show when vimeo video is finished? -
i'm new js, , can't figure out these event listeners on vimeo. need div, below video, hidden while video plays, , appear when video finishes. please help, have no idea start. i've tried everything.
this have far, no luck:
<div style="margin-left:2%;" > <iframe id="flash" src="http://player.vimeo.com/video/50234176?api=1&&portrait=0&byline=0&autoplay=1&title=0;player_id=player_1" width="760" height="460" frameborder="0"></iframe> </div> <div id="hello" >hello</div> <script> $('#hello').hide(); var iframe = $('#player1')[0], player = $f(iframe), player.addevent('ready', function() { player.addevent('finish', function(){ $('#hello').show(); }); }); </script>
initially, div can hidden using simple css display:none
, or calling $('#yourdivid').hide();
so, show div again when video finished, try way:
player.addevent('ready', function() { player.addevent('finish', function(){ $('#yourdivid').show(); }); });
Comments
Post a Comment