Hide element on overlay

Is it possible to hide a specific element on a frame when an overlay appears above that frame, and then have that element unhide when the overlay is closed?