Search.../

onOpen( )

Adds an event handler that is triggered when the menu container is opened.

Description

Adds an event handler that is triggered when the hamburger menu container is opened.

Syntax

function onOpen(handler: EventHandler): void
handler: function EventHandler(event: Event): void

onOpen Parameters

NAME
TYPE
DESCRIPTION
handler

The name of the function or the function expression to run when the element is opened.

Returns

This function does not return anything.

Return Type:

void

EventHandler Parameters

NAME
TYPE
DESCRIPTION
event

The event that occurred.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

Adds an event handler that runs when the menu container is opened

Copy Code
1$w("#myMenuContainer").onOpen((event) => {
2 let targetId = event.target.id; // "myMenuContainer"
3});