Adds method to show or hide depending on visibility.