@valentin1995 Sorry
. The hide() and show() functions return Promises - I always forget about that - and you can only do the show() when the hide is done.
Something like this:
$w.onReady(() => {
$w("#button1, #button2, #button3").onClick(event => {
$w("#image1").hide("fade").
.then( ( ) => {
let src;
switch(event.target.id) {
case "button1":
src = "xxxxxxx.jpg";//use the image source
break;
case "button2":
src = "yyyyyyyy.jpg";//use the image source
break;
case "button3":
src = "zzzzz.jpg";//use the image source
break;
}
$w("#image1").src = src;
$w("#image1").show("fade");
} );
})
})
Not tested, but that should give the right idea how to handle the Promise returned from hide().