Simple .show/.hide not working

Hello all, I made a simple bit of code to hide/show a button in editor x(as you can’t currently have hover buttons).

I made one, checked it and it worked fine. Made the rest and now I can’t get any of them to work. I’ve deleted it all and started again with no luck. I’m working very late and not sure if I’m just being stupid.

Here’s just the .show snippet of one vector image that doesn’t even want to work

export function shop1_mouseIn(event) {
    $w('#shop2').show();
}

All it is 2 vector images, vector 2 on top and hidden.

Any help please,
Many thanks!

EDIT:

I’ve tried again with this:

export function test_mouseIn(event) {
    $w('#test1').hide();
    $w('#test2').show();
}

export function test2_mouseOut(event) {
    $w('#test1').show();
    $w('#test2').hide();
}

Still not working unfortunately

Try to output some log (console.log) and see which code is called at which timing. That may give you some hints of the problem,

Try to output some log (console.log) and see which code is called at which timing. That may give you some hints of the problem,

Perhaps you lost all the connections between the Wix-Ui and the external functions.

Try this one…

$w.onReady(async function() {  
    $w('#test').onMouseIn(()=>{console.log("Mouse-In")
        $w('#test1').hide();$w('#test2').show();
    });
    
    $w('#test').onMouseOut(()=>{console.log("Mouse-Out")
        $w('#test1').show();$w('#test2').hide();
    });
});

This way you do not need to connect every single button with CODE.
Just paste in this CODE and run it.
To check if everything works, take a look onto CONSOLE.

Thank you! Unfortunately this didn’t make anything show up in the log. The code below worked though :slight_smile:

This sorted it. Thank you! God knows why my other code just suddenly stopped working then. WiIl use this in the future!