Add timing function on animation