Firefox中奇怪的脚本性能

时间:2015-09-12 05:33:29

标签: javascript performance firefox animation

我有一个带有JavaScript功能的网站,可以循环播放动画图像(任意海龟徽标)。 http://arbitraryturtle.github.io/

在Chrome上它看起来像预期的那样,与Microsoft Edge相同,但在Firefox上看起来非常麻烦,动画中的图像只是部分加载。

我的动画功能:

 <script type = "text/javascript">
    var anim;
    var index = 0;
    function Animation () {
        anim = setInterval(DoAnimation, 125);
    }
    function DoAnimation () {
        document.getElementById('anim').src = "media/Animation/" + index.toString() + ".png";
        index++;
        if (index == 19) {
            clearInterval(anim);
        }
    }
    window.onload = Fixes;
</script>

编辑注意到Firefox提供了#34;图像损坏或截断&#34;错误

0 个答案:

没有答案