【问题标题】:callback function of animate not working on ie7animate的回调函数在ie7上不起作用
【发布时间】:2013-02-20 07:54:33
【问题描述】:

我有以下几点:

 $(".transparentLoad").animate({
        opacity : 1,
                },100,function() {
                $(".transparentLoad").each(function(){ alert("IE &");
                                               $(this).css("filter" , " ");
                                           });
                                  });

还有,

 $(".transparentLoad").animate({
        opacity : 1,
                },function() {
                $(".transparentLoad").each(function(){ alert("IE &");
                                               $(this).css("filter" , " ");
                                           });
                                  });

还有,

    $(".transparentLoad").animate({
            opacity : 1,
                    },{complete:function() {
                    $(".transparentLoad").each(function(){ alert("IE &");
                                                   $(this).css("filter" , " ");
                                               });
                                      }
});

但这一切都会在 IE7 中出错。我需要做的是,在动画完成后,我需要删除添加的过滤器 css 样式。

【问题讨论】:

    标签: jquery internet-explorer callback jquery-animate


    【解决方案1】:

    这里多了一个逗号:

    opacity : 1, // <----
    

    【讨论】:

    • 哦,肯定会的。没有注意到这一点。将首先尝试。但是为什么它在 FF 和 chrome 上运行得很好呢??
    • 因为 IE7 和 8 的代码结构比 FF 和 Chrome 严格得多。
    • 哦.....这绝对解决了它。但是请保留这个问题,因为其他人可能会卡在这一点上,因为此解决方案没有重复的问题。
    • 打开它的问题是人们会在收到未被触发的回调时发现这个问题,然后意识到这个答案并不能解决这个问题。尽管此答案确实对您有所帮助,但对未来的访问者毫无用处。 meta.stackexchange.com/questions/167342/…
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多