How to hide a box under one extra condition

Hell @russian-dima I have attached a screenshot showing a mock-up of the button and box arrangement I am after. The box appears when I hover over the button. I achieve this by setting the box to ‘hidden’ by default, then adding this code to masterPage.js

export function button3_mouseIn ( event ) {
$w ( “#box1” ). show ();
}

I then get the box to hide when the mouse leaves the button using this code.

export function button3_mouseOut ( event ) {
$w ( “#box1” ). hide ();
}

As I wrote. The issue is what I really want to happen is the box hides when I am no longer mousing over the button UNLESS I have moused into the box area.

I did try to add a show command when the mouse goes into the box, but that seems to get overridden by the command set up hide the box when you mouse out of the button.

This is why I’m wondering if the solution is some kind of UNLESS conditional statement, i.e. hide the box when you mouse out from the button UNLESS you mouse into the box.