$w.onReady(function(){
$w(“#image11”).show(“FadeIn”);
Where do I put the seconds?
$w.onReady(function(){
$w(“#image11”).show(“FadeIn”);
Where do I put the seconds?
In order to add a delay, you should use the javascript setTimeout function. There are a lot of examples on the web how to do so.
For your case
$w.onReady(function() {
setTimeout(function() {
$w("#image11").show("FadeIn");
}, 1000);
}
This is the straightest answer I’ve gotten. Believe me, I researched for a while yesterday.
One canna shoot a bear, if one does not know what a bear looks like… XD
You are the best!!! woohoo!
I know this is old but…I’m wondering how you add this function to a whole list of commands. I have a button which shows and hides a bunch of variables, and I want to delay only one item. But I can’t seem to implement this script into the existing script…
export function button28_click(event) {
$w('#mediaPlayer3').show(); $w('#mediaPlayer4').hide(); $w('#button28').hide(); $w('#button24').show(); $w('#mediaPlayer5').hide(); $w('#mediaPlayer6').hide(); $w('#mediaPlayer7').hide(); $w('#text193').hide(); $w('#text194').hide(); $w('#text195').show(); $w('#text196').hide(); $w('#text192').show();
}
I want ‘#button24’ to be delayed a second. But I can’t for the life of me figure out how to delay only that element… Sorry. And thanks.
Just simply add it to your code!
Have a look at the effect functions reference here.
https://www.wix.com/corvid/reference/$w.EffectOptions.html
export function button28_click(event) {
$w('#mediaPlayer3').show();
$w('#mediaPlayer4').hide();
$w('#button28').hide();
$w('#button24').show(); // $w("#myElement").show("fade", fadeOptions);
$w('#mediaPlayer5').hide();
$w('#mediaPlayer6').hide();
$w('#mediaPlayer7').hide();
$w('#text193').hide();
$w('#text194').hide();
$w('#text195').show();
$w('#text196').hide();
$w('#text192').show();
}
Thank you, but I’m sorry, I’m not sure how that helps me. I want to do a setTimeout function, I don’t want to the button to show immediately, as it’s in the way of an image.
Yes, I’m very novice. If you could just quickly demonstrate the setTimeout function within my script, that’s all I need. Thank you.
Did you read the api info as it shows you there about the duration, delay and direction of the effect options.