Skip to content

Instantly share code, notes, and snippets.

Created January 6, 2010 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/270330 to your computer and use it in GitHub Desktop.
Save anonymous/270330 to your computer and use it in GitHub Desktop.
function getItemIndex(elm) {
var parent = glow.dom.get(elm.parentNode),
counter = 0;
parent.children().each(function(){
if (glow.dom.get(this).item(0) == glow.dom.get(elm).item(0)) {
return counter;
}
else {
counter++;
}
});
return -1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment