How do I create a container that expands when a question is asked to reveal the answers in the Iframe

I have a client that is planning to move the search bar to the top of the page. Right now it lives on the bottom of the page. It’s not only the search bar but the whole experience is Iframed onto the site. They want to move the search bar to the top, but not have all of the dead space that lives beneath the search bar in the experience today. How could they make the answers container smaller, but open to be larger after a question is asked?