Element#index method
Reported by MadRabbit | October 20th, 2010 @ 01:56 PM | in 2.2.0 Release
@bebraw asked for this one, it should return the index of the element among his siblings
Comments and changes to this ticket
-
MadRabbit December 25th, 2010 @ 08:32 PM
just an implementation note
function() { var node = this.parentNode.firstChild, index = 0; while (node !== this) { node = node.nextSibling; index ++; } return index; }
that should work faster than
childNodes
iteration. I think. gotta check it out. -
MadRabbit December 26th, 2010 @ 06:20 PM
- State changed from new to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
RightJS Core Tickets