Silly question but i can't seem to figure it out.
In the jquery documents it shows an option in the slideUp() function which is "always". which will call a function once the animation completes or fails How do i implement this?
http://api.jquery.com/slideUp/
$(".toHide").slideUp(function(){
alert();
})
basically want that alert to be called no matter what after the animation.. currently only calls if it completes not fail.
animation fails if the class doesnt yet exist
All animations can generate promise objects which have an always
method.
$(".toHide").slideUp().promise().always(function(){
alert("foobar");
});
however, animations can't "fail", so it's irrelevant anyway.
Options are typically in the format of {option: optionVal, option2: option2Val}
$('.toHide').slideUp({
always: function(Promise animation, Boolean jumpedToEnd){}
});
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