Вопрос

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?

Это было полезно?

Решение

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top