Show and Hide a text/image after X seconds.

Hi,
I am Francesco.
I m trying to create an animation for my text.
I would like to show a text using the fly animation and after X second i need to hide it.
I wrote my code:
$w.onReady( function () {
let flyOptions = {
“duration” : 10000 ,
“delay” : 0
};
$w( “#text96” ).show( “fly” , flyOptions);

let fadeOptions = {
“duration” : 5000 ,
“delay” : 15000
};

$w( "#text96" ).hide( "fade" , fadeOptions); 

});

But it doesn’t work.
Can you help me?

thanks…

Hi! In order to hide an element after a set amount of time you need to add a JavaScript SetTimeout function. A similar question is raised in the following post, please check it out: https://www.wix.com/corvid/forum/community-discussion/adding-a-delay

Thanks,
i tried with this code:
$w.onReady( function () {
let bounceOptions = {
“duration” : 2000
};

setTimeout( function () {
$w( “#text96” ).hide( “Bounce” ,bounceOptions);
}, 20000 );

});
Finally it works, but bouceOptions in exit mode doesn’t work, #text96 disappears instantly and not slowly. How can i solve this?

thanks