I am trying to create a timeline. There is a dragger element and some dynamically created timeframes (DIVs). When you drag the dragger the code will indicate what is the near left and near right div. The code works, you can see it at http://jsfiddle.net/3pXC9/15/ . Just drag the red handle, the blue dot is the left and the red is the right.
The problem is that I need to get the next left and right only for elements that have the same parent, same layer. Right now the code is getting all the keyframes elements from both layers. Is there a way to do that? How can I get the next and previous element that have the same parent?