Hi,
I have a little code under the “site" section of my site, www.letsstartdesign.com. that controls the menu and hamburger menu. The menu is supposed to glide away on viewport leave.
It was working just fine but I noticed today that it doesn’t seem to be working now on the live site. If I preview the site it works. Any ideas?
Heres the code under the site section:
let glideOptions = {
"duration": 1000,
"delay": 0,
"angle": 90,
"distance": 250,
};
$w.onReady(function () {
});
export function vectorImage3_click(event, $w) {
$w('#horizontalMenu1').show ("glide",glideOptions);
}
//vectorimage3 is the hamburger menu
export function horizontalMenu1_viewportLeave_1(event) { $w('#horizontalMenu1').hide ("glide",glideOptions); }
//horizontalMenu1 is the site menu that is supposed to glide in and out.
Lorraine
I think your problem is that you are trying to hide horizontalMenu1 when it leaves its own viewPort. It wouldn't make sense this way. It will be like matching a logic to itself like
if(sigma === sigma)
You should call the horizontalMenu1 to hide on some other element's viewport Leave such as an anchor
I have experienced the same. My code works in preview mode but not on live page. Is this cause of trial mode?
Any thoughts on how to resolve this please?
Hi @givemeawhisky thanks for the suggestion but that didn't work. It is weird that it works on the preview but not the published site anymore. Obviously if it was data you would sync it to live but this code is in the site code section.
You need to make an adjustment to your code.
$w('#horizontalMenu1').show('glide',{ "duration": 1000, "delay": 0, "angle": 90, "distance": 250 });
The effect options is to be the second parameter to the show function.