层次树:
mouse (depth:0, sequence:0)
* organ system (depth:1, sequence:1)
o visceral organ (depth:2, sequence:2)
urinary system (depth:3, sequence:3)
mesentery (depth:4, sequence:4)
* rest of mesentery (depth:5, sequence:5)
* urogenital mesentery (depth:5, sequence:6)
metanephros (depth:4, sequence:7)
* renal capsule (depth:5, sequence:8)
* nephrogenic zone (depth:5, sequence:9)
我有以下代码,它应该检索所选节点之后的第一个下一个节点的名称,该节点与所选节点具有相同的深度,并且序列值应该大于 selected_node_sequence :
/** node id has the same value as node_depth **/
var selected_node_depth = parseInt($j(element).attr('APO_DEPTH'));
var selected_node_sequence = parseInt($j(element).attr('APO_SEQUENCE'));
var first_next_node_with_same_depth = $j("#"+selected_node_depth).next().attr("name"); [where first_next_node_with_same_depth sequence value > selected_node_sequence]
例如,如果 'selected_node' = 肠系膜,则 'first_next_node_with_same_depth' 应该是后肾
任何关于如何做到这一点的建议都非常感谢