Hi, I have an image and a video in the same position with different z-index value. I want to do fadeOut in the image and at the same time fadeIn the video to make a sort of dissolve effect. I can not get the fadeIn () applied to the iframe that contains the video.
HTML
<div class="imagen-video"></div>
<iframe class="videoContainer__video" src="https://www.youtube.com/embed/Ha2f8zU3QP0?modestbranding=1&autoplay=1&controls=0&fs=0&loop=1&rel=0&showinfo=1&disablekb=1&iv_load_policy=0" frameborder="0"></iframe>
CSS
.imagen-video{
background-image: url("../images/img-video.jpg");
z-index: -1;
width: 100%;
height: 100%;
background-size: cover;
position: absolute;
}
iframe {
/* optional */
width: 100%;
height: 100%;
z-index: 0;
position: absolute;
visibility: hidden;
}
JQUERY
$(document).ready(function () {
setTimeout(function(){
$('.imagen-video').fadeOut(500);
}, 2500);
setTimeout(function(){
$('.videoContainer__video').fadeIn(500);
},2500);
});