I can’t call callback after animation ends. Here is my animation function:
function animate( parentElement, callback )
{
parentElement.animate({
"height" : "hide", "opacity" : 0.0
}, { duration : "slow"}, "linear", callback);
}
And here is calling it:
animate( $(this).parent(), function() { alert('test'); } );
Alert doesn’t show, why?
Here’s your problem:
That second parameter? It’s supposed to be either a string or a number. When you pass in an object, jQuery doesn’t know what to do with it. Switch to this:
…and it’ll work just fine.