The show and hide functions can trigger a function when they have finished. This can be used to trigger the accompanying after event, meaning that we could to all of this function declaratively.