I have these simple lines for my client’s website www.think-recruitment.com and it works fine
export function anchor1_viewportEnter(event, $w) {
$w("#menu1").show();
$w("#menu2").hide();
}
export function anchor1_viewportLeave(event, $w) {
$w("#menu1").hide();
$w("#menu2").show();
}