Bug Tracker

Opened 11 years ago

Closed 11 years ago

#11881 closed bug (cantfix)

.queue length

Reported by: Frackher Owned by: Frackher
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:

Description

When you call a multiple selector and use the callback of animate, if you check the queue length it returns 1 and not 0.

Example, one element of the selection animated : console.log "rest in queue 1"

Example, 3 elements of the selection animated : console.log "rest in queue 1" console.log "rest in queue 0" console.log "rest in queue 0"

Code

$("#id .class:lt(3)").animate({right: +=20},1000,function(){rebind();})

function rebind()
{
 if($("#id .class").queue().lenght<1)
 {
  //do something
 }
}

Change History (3)

comment:1 Changed 11 years ago by sindresorhus

Owner: set to Frackher
Status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

comment:2 Changed 11 years ago by Frackher

Status: pendingnew

Okay, thanks, I've done the job here : http://jsfiddle.net/Dq3uV/24/

It seems that the issue is still going.

comment:3 Changed 11 years ago by gnarf

Resolution: cantfix
Status: newclosed

http://jsfiddle.net/ZY3CX/ - The "inprogress" sentinel is still in the queue until after the complete function runs. Sorry that it is confusing you, but there really isn't anything we can do about it. If you want to see if there are any more animations to run after this one, you should be checking that length > 1 not length > 0.

Note: See TracTickets for help on using tickets.