I have this code:
$('.SomeDiv').slideUp(400);
setTimeout(function () { SomeFunction(); }, 400);
How do I rewrite this and remove the setTimeout
so that SomeFunction
becomes a call-back function of slideUp
.
Thanks.
Method slideUp()
has callback
argument. So you can do it easily with:
$(".SomeDiv").slideUp(400, function() {
// Animation complete.
SomeFunction();
});
In fact you can just simply use:
$(".SomeDiv").slideUp(400, CallBackFunction);
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