I tried that, but when I would click on my switch, nothing would happen. I was also trying this… but it made one of my elements disappear right away and then it never came back when I clicked the switch
$w . onReady ( function () {
if ( $w ( ‘#switch1’ ). checked ) {
$w ( ‘#image1’ ). expand ();
$w ( ‘#box51’ ). collapse ();
$w ( “#box52” ). collapse ();
//next item to expand
} else
$w ( “#image1” ). collapse ();
$w ( “#box52” ). expand ();
$w ( ‘#box53’ ). expand ();
//next item to collaps
}
);
I also tried this one, but it did not work either
export function switch1 ( event ) {
if ( $w ( ‘#switch1’ ). checked ) {
$w ( ‘#box52’ ). expand ()
//next item to expand
} else
$w ( “#box52” ). collapse ()
//next item to collaps
}