Editor X - Hover on Hamburger Menu opens lightbox

Hello,
I’m losing my mind because I’m trying to make a lightbox or a container apper on my page when I hover or even when I click on my hamburger menu in my header. But apparently I am unable to recall an element from the page.

I tried with

export function hamburgerMenu_click (event) {
$w ( ‘#boxMenu’ ). show ();

or even

$w ( “#hamburgerMenu” ). onMouseIn (( event ) => { $w ( “#boxMenu” ). show ( “slide” , { direction : “right” })});

But it doesn’t work either way.

Can someone help?

Lightbox require a different API call.
Try this:

import wixWindow from 'wix-window'

//set up event handler in masterPage.js
export function hamburgerMenu_mouseIn(event) {
    wixWindow.openLightbox("LightboxName");
}

If the hamburger menu is on your header or another master section then this code needs to placed on the masterPage.js page. (You can find the page by clicking the dev mode icons " {} ", then make sure you are viewing your pages – first icon in left panel – and it will be the last file under your site’s static pages.)

If you were using a container, you can do this with the show/hide call or expand/collapse instead of wix-window.

It doesn’t work for me :frowning:

Make sure the code is placed in the masterJs page. Also for lightbox name, make sure it is the actual lightbox name that is shown as the page name, not the code name. Should work. Here’s the documentation .