Hey everyone, I had a lightbox side menu, but unfortunately, it had a huge delay when clicking the "hamburger" menu button. Instead, I switched to a pinned container box with individual buttons. It works great at first, but after using it to navigate to one of the linked pages, the menu quits appearing when clicking the hamburger. I'm not sure what to do with this as I believe my code is correct, however, I could be wrong as I am a beginner when it comes to Corvid/Javascript. The website is https://nn1406.wixsite.com/mysite (it is an early version of a new site for the company I work for). This is my site code:
import wixLocation from 'wix-location';
export function hamburger_click(event) {
$w('#menu').show('FlyIn')
$w('#hamburger').hide('FlyOut');
}
export function x_click(event) {
$w('#menu').hide('FlyOut')
$w('#hamburger').show('FlyIn')
}
export function button20_click(event) {
wixLocation.to("/downloads")
$w('#menu').hide('FlyOut')
$w('#hamburger').show('FlyIn')
}
export function button21_click(event) {
wixLocation.to("/disaster-relief")
$w('#menu').hide('FlyOut')
$w('#hamburger').show('FlyIn')
}
export function button22_click(event) {
wixLocation.to("/warrior")
$w('#menu').hide('FlyOut')
$w('#hamburger').show('FlyIn')
}
export function button23_click(event) {
wixLocation.to("/about-us")
$w('#menu').hide('FlyOut')
$w('#hamburger').show('FlyIn')
}
Thanks in advance!
If you are wanting your menu to open on every page then put this part in your site code so that it applies to your whole site.
export function hamburger_click(event) { $w('#menu').show('FlyIn') $w('#hamburger').hide('FlyOut'); } export function x_click(event) { $w('#menu').hide('FlyOut') $w('#hamburger').show('FlyIn') }
As for the rest of your code, which take it is on your page code tab, then note that the code will tell the website to move the user to a new page before the hide and show functions work.
So, in theory, they are redundant as they are not applied as the user is moved to a new page before they can be applied.
export function button22_click(event) { wixLocation.to("/warrior") $w('#menu').hide('FlyOut') $w('#hamburger').show('FlyIn') } export function button23_click(event) { wixLocation.to("/about-us") $w('#menu').hide('FlyOut') $w('#hamburger').show('FlyIn')