Fixed javascript animation event in chrome