You probably would need to write your own Javascript for this purpose. There doesn't appear to be an option in Splunk to do this in a "native" way.
(Any reason you don't want to use the built-in top-menu capability? Seems like a lot of work to build your own.)