Ok, so here's what I've got:
I have a list of elements cached in a variable:
elementList = $(".list-of-elements-with-this-class");
I also have a dynamically generated element from that list cached in another variable:
elementList.click(
function()
{
cachedItem = $(this);
}
);
What I want to do is locate cachedItem in elementList and then select cachedItem's previous or next sibling in the list.
So pseudo code would look like this:
nextCachedItem = elementList.find(cachedItem).next();
or
prevCachedItem = elementList.find(cachedItem).prev();
Obviously, the above doesn't work. :-)
Thanks for your help in advance!
-Tim.