My question would be why not handle the click event always but only once? Register the event each time you show the overlay seems redundant.