Hey guys,
this is my jquery code
jQuery(document).ready(function(){
jQuery('.start_video').click(function(){
jQuery(this).fadeOut("slow", function(){
jQuery('#video').animate({ opacity: 'show' }, "slow");
jQuery('#video_stream').animate({slideDown: 'slow' }, "slow");
});
});
jQuery('.close_video').click(function(){
jQuery('#video').fadeOut("slow", function(){
jQuery('.start_video').fadeIn("slow");
});
});
});
Here is my html code
<div id="video_stream">
<a href="#" class="start_video">Start Video</a>
<div id="video" class="hidden">
<a href="#" title="#" class="close_video">Close</a>
</div>
</div>
</div>
I have some standard CSS. When the start_video link is clicked, the start_video link fades out and after that, the video div fades in. Inside the video div is a close_video link. When that link is clicked, the video div fades out and the start_video link fades in. However, I want to also have the "video_stream" div that wraps everything to slide down as its height changes with the fading in of "video" and also slideUp when the height changes with the fadeOut of "video".
I was wondering how to do this. I tried adding in slideUp functions in Jquery but I think I was putting them in the wrong place. I also tried the .animate() function using the slideUps but that did not work. I want it to be a smooth slideDown while the "Video" div is fading in and vice versa.
Thanks in advance!