I have my page set up so when a user presses play on the video it dims the background. When they press pause it will turn off the dimming effect. I am trying to add an ease transition effect so it's a little smoother when the effect is turned on and off. I'm not sure where to add the transition css because what I've don't so far doesn't seem to work.
HTML
<div id="overlay"></div>
<div class="col-md-6">
<div id="introRight">
<video poster="img/WhoWeAre.jpg" preload="auto" controls>
<source src="video/WhoWeAre_HI.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
<source src="video/WhoWeAre_HI.ogv" type='video/ogg; codecs="theora, vorbis"'>
<source src="video/WhoWeAre_HI.webm" type='video/webm; codecs="vp8, vorbis"'>
</video>
</div> <!-- end introRight -->
</div>
JAVASCRIPT
<script>
$("video").on('play',function(){
$("#overlay").show();
});
$("video").on('pause',function(){
$("#overlay").hide();
});
$("video").on('ended',function(){
$("#overlay").hide();
});
</script>
CSS
#overlay {
display:none;
position:fixed;
width:100%;
height:100%;
top:0;
left:0;
opacity:0.8;
background-color: #282828;
z-index: 20;
transition: opacity .25s ease-in-out;
-moz-transition: opacity .25s ease-in-out;
-webkit-transition: opacity .25s ease-in-out;
}
video {
width: 100% !important;
height: auto !important;
margin: 0 auto;
margin-top: 50px;
z-index: 999;
position: relative;
-webkit-box-shadow: 3px 3px 11px 0 rgba(50, 50, 50, 0.75);
-moz-box-shadow: 3px 3px 11px 0 rgba(50, 50, 50, 0.75);
box-shadow: 3px 3px 11px 0 rgba(50, 50, 50, 0.75);
}