1

I'm using two jQuery queues and i want one of them to dequeue after another is finished. How can I know if the first one is finished? Should I use a third queue??!

Here is what I have:

var $q = $({});    
$q.queue('firstQ', function (next) {
    // blah blah
    next();
});

$q.queue('secondQ', function (next) {
    // blah blah
    next();
});

$q.dequeue("firstQ");
$q.dequeue("secondQ");

1 Answer 1

4

You can use:

.queue().length

to detect .queue() length and if queue end then it'll return 0;

Sign up to request clarification or add additional context in comments.

3 Comments

So I should set an interval to check it?
I need something like "then()"!
@XIII yup, you can use interval or then

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.