开发者

jQuery, get Previous and Next element on Drag, based on parent

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?


Is this what you want?

http://jsfiddle.net/3pXC9/17/

I separated the function that selects the closest keyframes and then you send in the container for the layer as a parameter.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜