Create and trigger css transition animations from javascript