Use setTimeout()here. After the animation finishes moving up, it will launch an anonymous function that wraps setTimeout(), which calls your function after about 800 milliseconds.
$('#foo').slideUp(300, function() {
setTimeout(function() {
myOwnFunction(1, 2, 3);
}, 800);
});
function myOwnFunction(a, b, c) {
alert(a + b + c);
};
It does not matter that it was defined below, since its definition should be raised to the top.
source
share