You can use the client-side frameworks or libraries to do this. For example, you can use jQuery to hide or show the iframes.
$('button').click(function() {
});
Then you can use some CSS based styling techniques to change the width of the elements (iframe).