Fixed animation bug

Because javascript + css insist on driving me crazy.