Skip to main content

Bug Tracker

Side navigation

#11881 closed bug (cantfix)

Opened June 08, 2012 02:52PM UTC

Closed July 03, 2012 06:19PM UTC

.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
 }
}
Attachments (0)
Change History (3)

Changed June 08, 2012 11:25PM UTC by sindresorhus comment:1

owner: → 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.

Changed June 22, 2012 10:29AM UTC by Frackher comment:2

status: pendingnew

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

It seems that the issue is still going.

Changed July 03, 2012 06:19PM UTC by gnarf comment:3

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.