Skip to content

Instantly share code, notes, and snippets.

@jakearchibald
Forked from anonymous/gist:270330
Created January 6, 2010 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakearchibald/270332 to your computer and use it in GitHub Desktop.
Save jakearchibald/270332 to your computer and use it in GitHub Desktop.
function getItemIndex(elm) {
var siblings = elm.slice(0,1).parent().children(),
i = siblings.length;
while(i--) {
if (siblings[i] == elm[0]) {
return i;
}
}
return -1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment