Question

I'm trying to make this working:

jQuery('.header').animate({ opacity: 1 }, {queue:false,duration:250},function(){
        console.log('complete');
});

but unfortunately callback isn't triggered.

Do you know why?

Was it helpful?

Solution

When passing an object as the second argument, any callback you want to be executed should be included in that object.

jQuery('.header').animate({ opacity: 1 }, {
    queue:false,
    duration:250,
    complete: function(){
        console.log('complete');
    }
});

You can learn more on how the API works in their documentation

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top