On release hide layer

is there a way to hide/show layers on the lcick onf a button?