Hi everyone. I have managed to create with wixcode a decent animated hamburger menu for the desktop, that being said, it is not working as expected for some reason.
here is the setup: I have a flipping hamburger button with a slide out menu setup up like this:
export function menuBtn2_click(event) {
$w('#menuBtn2').hide("flip", flipOptionsR);
$w('#closeBtn2').show("flip", flipOptionsL);
$w('#bm2').show("slide", slideOptionsT2);
$w('#bm3').show("slide", slideOptionsR1);
}
export function closeBtn2_click(event) {
$w('#menuBtn2').show("flip", flipOptionsL);
$w('#closeBtn2').hide("flip", flipOptionsR);
$w('#bm2').hide("slide", slideOptionsT3);
$w('#bm3').hide("slide", slideOptionsR2);
}
The slide out “bm3” box has all the menu text links that lead to different pages on my site
I also added code for every link that when clicked the menu is closed as such:
export function homeLink_click(event) {
$w('#menuBtn2').show("flip", flipOptionsL);
$w('#closeBtn2').hide("flip", flipOptionsR);
$w('#bm2').hide("slide", slideOptionsT3);
$w('#bm3').hide("slide", slideOptionsR2);
}
This is repeated with every link that I have in the menu.
Additionally I have code that every-time a page loads the hamburger menu button appears with an animation as such:
export function page1_viewportEnter(event) {
$w('#menuBtn2').show("float", floatOptions1);
}
so if i play with the open/close functionality of the menu button everything works. Once I click any link the menu closes and i am redirected to the target and as the new page loads the menu button appears as programmed. However, once I click it again to navigate elsewhere it flips and disappears and the close button/slide out menu does not appear… I can’t figure out what I am doing wrong… If anyone has any ideas please help me - I am going crazy here!
Thanks in advance