Animation duration control function added.