Fade in and out a div contains video embedHTML in jquery

Posted by Ahmy on Stack Overflow See other posts from Stack Overflow or by Ahmy
Published on 2010-04-08T15:39:14Z Indexed on 2010/04/08 15:43 UTC
Read the original article Hit count: 141

Filed under:
|

I have a div and three links when a link is clicked the div is set its innerHTML with an embedHTML of video and i need to cause some effects when the current div video is changed on clicking the link

Example :

<a id="Link1" onClick="ChangeVideo(1)">Link1</a>
<a id="Link2" onClick="ChangeVideo(2)">Link2</a>
<a id="Link3" onClick="ChangeVideo(3)">Link3</a>
<div id="CurrVideo"></div>
<script type="text/javascript" language="javascript">
//The ArrEmbed is an array that is set on the load of the page::
var ArrEmbed = new Array();
function ChangeVideo(index)
{
   $('#CurrVideo).fadeTo(1000,0.25,function(){
   document.getElementById("CurrVideo").innerHTML = ArrEmbed[index-1];
   });    
    $('#CurrVideo).fadeTo(500,1.25); 
}
</script>

The effect is not noticeable and fading with opacity diminshing is not noticed even if the duration time is increased (e.g. 'slow') and when i replace the EmbedHTML with image this code is applicable and the effect of fading is noticed but with the video it is not noticeable so how can i solve this problem ?

Thanks in advance for any try

Note: The embedHTML differ as it may come from youtube or any server or from my JWPlayer.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about html