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 !!!
We will use the Timer() and schedule() functions to call a function after a delay. Let's look at an example of this function.
Added to jQuery in version 1.4, the . delay() method allows us to delay the execution of functions that follow it in the queue. It can be used with the standard effects queue or with a custom queue. Only subsequent events in a queue are delayed; for example this will not delay the no-arguments forms of .
In order to run a function automatically after waiting for some time, we are using the jQuery delay() method. The . delay() method in jQuery which is used to set a timer to delay the execution of the next item in the queue.
Use setTimeout
jQuery("#tem_forma").hide();
setTimeout( function() { jQuery("#win").hide(1000); }, 3000);
This will make sure your functions gets executed after 3 seconds.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With