Show and hide SubHeader *solved*

Does anyone know how to hide and show a subheader from a button click in the main header bar? I have tried a few things without any luck. I will put together a code pen to show you what I am doing.


Here is my codepen
As you can see I have the search subheader dropping down on search icon click, but there is an issue when it is hidden again? It is not playing ball and leaves a blank subheader space there. Any help please?

I fixed it, you can see in the codepen.