HI
I'm looking for a way to fade out a div when a video starts playing. Basically as soon as the video (which auto starts playing) has loaded or started playing the div fades out.
I'm also using 'query-simplevideo.js' to control the video playback if that's important to know.
here'a some of the code I have in place now:
...........................................................................................................................
IN the BODY:
...........................................................................................................................
<div id ="overlay">JImmy</div>
<video id="test">
<source src="vids/danse2.mp4" type="video/mp4">
<source src="vids/danse2.ogv" type="video/ogg">
</video>
...........................................................................................................................
and in the HEAD:
...........................................................................................................................
<script >
$(document).ready(function() {
$('video').simpleVideo();
$('#test').trigger('play');
});
</script>
...........................................................................................................................
I'm looking for something sort of like:
$('#test').on('play', function(e) {
$('#overlay').fadeOut('slow');
});
But of course this doesn't work.
Any suggestions?