Fixed some errors

It wasn't possible to animate multiple elements at simultaneously;
the translate-z-value was set to 0 every time because the calculation
returned NaN.