2 ms·
> opacity = (1 + wolfAni[currentFrame][i]) / 10; This could be pre-calculated. >if(opacity != matrix[i].style.opacity); matrix[i].style.opacity = opacity Tha
by icebraining 15y ago
> opacity = (1 + wolfAni[currentFrame][i]) / 10;
This could be pre-calculated.
>if(opacity != matrix[i].style.opacity); matrix[i].style.opacity = opacity
That semicolon after the 'if' means the next line will always be executed regardless of the value of the condition, so the if is useless there.
--
In the same spirit, I love the AA-Project[1], especially their demo, BB[2]. Now that is fast.
[1]: http://aa-project.sourceforge.net/index.html http://aa-project.sourceforge.net/index.html
[2]: http://aa-project.sourceforge.net/bb/ http://aa-project.sourceforge.net/bb/