0

我在隐藏的 div 中有一个 swf。它在第 1 帧停止,我希望它在 jquery 脚本完成后开始播放。这是我的代码:

    function doFlash() {
    $("#first_menu").hide("clip", { direction: "vertical" }, 500, function() {
    $('#flash_container').animate({top: 0}, 1500, function(){
    getElementById('FlashID').Play()});});
    };

但它根本不工作,它做动画但不开始播放 swf。提前致谢。

更新: wmode:transparent 问题现已修复,但 swf 仍未在 FF 和 Chrome 中播放。我按照 Fabrício Matté 的建议使用了 swfobject,但由于某种原因,它只是在 IE 中工作。我认为这可能与 oject 的 id 有关,但我不确定。这是示例的链接:http: //molcajete.com.mx/natura/videos_fito/感谢您的帮助!

4

2 回答 2

0

这个 API:http ://api.jquery.com/stop/或者.is('animate')可能有助于检查动画是否完成。

此外,如果您愿意,您可以设置在动画完成时调用的回调:http: //docs.jquery.com/Effects/animate

示例代码

if( $("#fooDov").is(":animated") ){
  alert("HULK!");
}

你的代码

  function doFlash() {
    $("#first_menu").hide("clip", { direction: "vertical" }, 500, function() {
    $('#flash_container').animate({top: 0}, 1500, function(){
       if( $(this).is(":animated") )
            getElementById('FlashID').Play()});});
    };
于 2012-05-25T02:53:18.433 回答
0

看来我只需要在对象上写下“名称”。

于 2012-05-30T22:23:57.190 回答