Add shown and hidden events