Add animation function.