How to change image on click

I want to make a button which changes its image or text by clicking on it (like close/open button on pictures below). I probably must be using Toggle Visibility with two buttons with different pictures but how do I make them have the same position?

If the buttons/images are side by side, or immediately one above the other in the same bloc, the objects will change in the same space. This will give the illusion that one button/image is being replaced with the other.

Yes you’re right - it does, but the process of transition is visible and not good-looking(

Is there any other solution?

This forum was probably built on Blocs (at least it should be) - how this feature is realised here?

My Site.bloc (723.9 KB)