Toggle menu navbar

Hello everyone, I’m new to wix. Currently, I’m making a landing page, with a task to hide/show the menu bar. Please tell me how to do it, I don’t understand velo apis very much. Thanks everyone


1) Activate DEV-MODE in your EDITOR.
2) Select the element you want to modify and memorize it’S ID.
3) In general the starting code-sequence is already on your page.

$w.onReady(()=>{
    // here your code....
    // here your code....
    // here your code....
    // here your code...
});
  1. Add the following code-line into your code…
    $w('#elementIDhere').show();
    …or…
    $w('#elementIDhere').show();

  2. You also need an onClick-event-trigger…
    $w('#myButtonIDhere').onClick(()=>{.........});

$w.onReady(()=>{
   $w('#myButtonIDhere').onClick(()=>{
        $w('#elementIDhere').show();
    });
});
  1. Now add some if-else-conditions to your code and generate your TOGGLE-FUNCTION…
    if(…) {…} else {…}
1 Like

thank you for your solution <3. be side that i want to know how about handle touch swipe on mobile. I have slide in the carousel, using the button previour and next to change slide is a default mode. I wanna on Mobile, user can touch to swipe to change slide without using the button arrow (previous/next). How can I do that?