Make closing animation work.

Avoid display: none, since that breaks animations.