Open & Close before loading next one

Hi!

I’ve seen this “effect” on other sites and I wonder how it’s done.
Let’s say I’ve got 3 buttons: About, Portfolio & Contact.

Then, when you click on a certain button a window appears. (with some kind of “flashy” animation.)

Then If you click on another button, the current window that is open closes(also with som “flashy” animation") before the other one is displayed. It doesn’t just go directly to the new window.

Hope ya’ll know what I mean.

Thank you!!