event handling for dynamic menu elements and first contents