Bug Tracker

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#11154 closed bug (wontfix)

.each() callback.

Reported by: brunolazzaro Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:

Description

It would be great if .each() had a callback function that fires when all nodes have been traversed.

Something like:

$('div').each(fn, callback)

$('a').each(function(){ code here for manipulating the links }, function(){ i'm done, fire this function. })

Change History (2)

comment:1 Changed 8 years ago by Rick Waldron

Resolution: wontfix
Status: newclosed

Feature creep. Can easily be inlined: http://jsfiddle.net/rwaldron/p4Yp4/

comment:2 Changed 8 years ago by gnarf

I'd also like to point out that .each() is synchronous, so this:

$('a').each(function( index, element ) {
  console.log( "Index", index );
});
console.log( "I'm Done" );

Works just as well...

Note: See TracTickets for help on using tickets.