Linking interactions with if/else functions

Hi All,

I am trying to code a simple function in my wix page. There is an interactive banner with two slides, ‘events’ and ‘interiors’. There are also two galleries below, one hidden on load and one unhidden on load. I want the ‘onChange’ command for the banner to toggle between these galleries with conditional statements such as:

“onChange, if gallery a is hidden then show a and hide b and vise versa.”

Here’s how far I’ve gotten, I just don’t know how to link interactions and if/else statements:

export function fullWidthSlides2_change(event) {
 if ($w("#gallery1").hidden)
     $w("#gallery1").show("fade", fadeOptions)
     $w("#galleryinterior").hide("float", floatOptions)
 
    }

else if ($w("#gallery1").isVisible) {
     $w("#galleryinterior").show("fade", fadeOptions)
     $w("#gallery1").hide("float", floatOptions)
    }