I want execute 2 functions in jquery but i need the second function execute after 3 seconds more or less , i try this , but if use this , the second function of jquery never execute finally , i put the script i create and i try works continue :
jQuery("#tem_forma").hide();
delay(3000);
jQuery("#win").hide(1000);
How i can use delay function for wait 3 seconds for execute the next function , in this case the second
Thank´s , Regards !!!
I want execute 2 functions in jquery but i need the second function execute after 3 seconds more or less , i try this , but if use this , the second function of jquery never execute finally , i put the script i create and i try works continue :
jQuery("#tem_forma").hide();
delay(3000);
jQuery("#win").hide(1000);
How i can use delay function for wait 3 seconds for execute the next function , in this case the second
Thank´s , Regards !!!
Share Improve this question asked Jun 21, 2013 at 19:53 user2501504user2501504 3113 gold badges7 silver badges15 bronze badges3 Answers
Reset to default 13Use setTimeout
jQuery("#tem_forma").hide();
setTimeout( function() { jQuery("#win").hide(1000); }, 3000);
This will make sure your functions gets executed after 3 seconds.
You can use .delay()
like this:
jQuery("#tem_forma").hide();
jQuery("#win").delay(3000).hide(1000);
But be aware that .hide()
needs to have (time) parameter to work in conjunction with .delay()
Is this what you meant?
jQuery("#tem_forma").hide();
jQuery("#win").delay(3000).hide(1000);