Hallo,
Having a starting point inside a nested structure I would like to get the first child of the root parent, but this child must be in the "parent-child line" with the starting point.
For example if the structure is this one:
If I start searching from current1 I should get b1, if I start from current2 I should get b2.
Having a starting point inside a nested structure I would like to get the first child of the root parent, but this child must be in the "parent-child line" with the starting point.
For example if the structure is this one:
Code:
<ul id="a">
<li id="b1">
<ul>
<li id="c1"></li>
<li id="current1"></li>
</ul>
</li>
<li id="b2">
<ul>
<li id="c3"></li>
<li id="c4">
<ul>
<li id="d1"></li>
<li id="current2"></li>
<ul>
</li>
</ul>
</li>
</ul>
If I start searching from current1 I should get b1, if I start from current2 I should get b2.