[jQuery] Re: Find index of div with class "selected"

2008-10-21 Thread jimster
Much appreciated! Works wonderfully. I guess I don't quite understand the use of variables and commas inside element declarations. So much to learn!

[jQuery] Re: Find index of div with class "selected"

2008-10-21 Thread ricardobeat
index() returns -1 when the element is not found. It fails because the object array passed contains elements that are not children of your first object. In your case you need to store a reference to the parent element and pass only it's children to the index() function: var kid = $('#container >

[jQuery] Re: Find index of div with class "selected"

2008-10-21 Thread jimster
It seems like I've got somewhere - though I am still confused.