I should also point out that hide() and show() both return a Promise. So, when you hide(), you should wait till the Promise is fulfilled before doing the show(). Something like this:
$w("#group1").hide()
.then( ( ) => {
console.log("Done with hide");
$w("#group1").show("fade", fadeOptions);
} );
Are we having fun?