Frage

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?

War es hilfreich?

Lösung

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top