Search code examples
javascriptjqueryyoutubeyoutube-apijquery-effects

Possible to fade out an embedded Youtube video?


Is it possible to fade out a Javascript embedded Youtube video using Javascript/jQuery? At the moment I have embedded a video and when I try to fade it out using jQuery's fadeOut() function, it just disappears instead of fading. Is it possible to have a fade out effect on it using Javascript/jQuery or any other Javascript libraries (without any extra HTML elements)?


Solution

  • You should use wmode = "transparent". See Create a transparent background in a Flash movie

    Working Demo

    <div id="wrapper">
    <object>
      <param name="movie" value="..."></param>
      <param name="wmode" value="transparent"></param>
      <embed class="video" src="..." type="application/x-shockwave-flash"
             wmode="transparent"></embed>
    </object>
    </div>
    

    Usage

    $("#wrapper").fadeOut(2000);