Why not just pure CSS ?
I probably wasn't clear enough on what I want to do.
For various reasons, we are jusing JSP instead of XHTML + Facelets. We can't use XHTML since some of the components the application uses just don't render properly if they render at all.
Here is the scenario: when a user clicks on a button I re-render some part of the page - normal a4j stuff so far.
Whilst the re-rendering occurs an exception happens in the application.
The rich:messages component must be AFTER the part of the page which causes the exception otherwise the exception will not be seen by the rich:messages component - because the exception is caused by the render phase.
But I want the exception to be seen at the top of the page, not the bottom.
So I need to make the top bit disappear after it has just appeared.
Doing another ajax request doesn't work as all of the messages in the JSF framework are then trashed as part of the new lifecycle. So I have to make everything happen in 1 render of the page: ajax request, render top bit, render messages, if messages are rendered make top bit disappear until messages bit is closed.