How can I do this?

Hi everybody,

I didn’t know how to explain good so I make a picture. How can I do something like that?

When you click on A or B it becomes bigger or go back to the initial status if it’s already big at the moment you click.

Hope it’s clear…

Thanks
A