简体   繁体   English

在mozilla / IE中淡出将无法正常工作

[英]fade out in mozilla/IE wont work properly

here's one plugin i am trying to create 这是我要创建的一个插件

http://jsfiddle.net/9FcN3/2/ http://jsfiddle.net/9FcN3/2/

it works perfectly in chrome, but i cant get it working in Firefox and IE.. in Firefox second fade out does it without animation(simply disappears), and in IE its complete mess(starts function without click and doesn't animate fades) 它在chrome中可以正常工作,但是我无法在Firefox和IE中使用它。

can you please at least push me in right direction on this? 您能否至少请我向正确的方向推动?

trying to get it working in IE version 9 试图让它在IE 9中正常工作

HTML: HTML:

<div id="holder">
    <div id="thmb"></div>
    <div id="logo"></div>
    <div id="player">
</div>
<script type="text/javascript" src="js/ytplayer.js"  charset="utf-8></script>

</div>

JS: JS:

  $('#thmb').click(function(){
  $(this).fadeOut('slow', timeout());
    function timeout(){
        setTimeout(function(){
        $('#logo').fadeOut('slow',play());
    },2000);
    }
  });

 function play() {
   if (player) {
     player.playVideo();
   }
  }

You are calling the function play,not assigning a reference to it. 您正在调用函数play,而不是为其分配引用。

$('#logo').fadeOut('slow',play());

needs to be 需要是

$('#logo').fadeOut('slow',play);

The other problem you have with IE is CSS. IE的另一个问题是CSS。 The layers are not being positioned the way you think they are. 图层未按您认为的方式放置。 You should be setting wmode: "opaque" 您应该设置wmode: "opaque"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM