I want to scroll to a specific index number in a list of child elements.
What is the simplest and effective way to do this.
The only restrictions are where the index is a number from 0 to n-1. And I retrieve index from $(this).index(); when the item was clicked and saved to scroll again at some other point in time like in a memory game.
I was thinking something like this but more eloquent:
$("child:nth-child(" + index + ")").scroll();
<parent>
<child/>
<child/>
<child/>
...
<child/> <!-- nth child-->
</parent>
$.scrollTop($(this).offset().top);