Better solution to last commit.

This fixes the animation issues in html 5 as well. However it is still
very slow when running over a network