Jquery 在ie7中设置重复动画

Jquery 在ie7中设置重复动画,jquery,jquery-animate,Jquery,Jquery Animate,如何使Jquery在ie7和IE8中连续循环动画?(ie9/铬合金工作良好) 这是我的密码 $(document).ready(function() { var $grower = $('#rain'); function runIt() { $grower.animate({left:'48%',top:'800px',opacity:'0'}, 1000, function() { $grower.r

如何使Jquery在ie7和IE8中连续循环动画?(ie9/铬合金工作良好)

这是我的密码

$(document).ready(function() {
        var $grower = $('#rain'); 

        function runIt() {
            $grower.animate({left:'48%',top:'800px',opacity:'0'}, 1000, function() {
                $grower.removeAttr("style");

                setTimeout(function() {
                    runIt();
                }, 100);
            });
        }

        runIt();
    });

我在IE 8中尝试过这个,它对我有效

看一看

HTML

<div id="rain"></div>
CSS

#rain{
    width:50px;
    height:50px;
    background-color:#000;
}

它是否在IE7/8中工作过一次并且根本没有抛出错误?请尝试$grower.css({opacity:1,left:'auto',top:'auto');而不是removeAttr('style')
#rain{
    width:50px;
    height:50px;
    background-color:#000;
}