【问题标题】:In Tritium, can I select all children of a node?在 Tritium 中,我可以选择一个节点的所有子节点吗?
【发布时间】:2014-04-16 16:22:05
【问题描述】:

我有一个包含多个子 div 的 div。有些有 ID 和类,有些没有。

我使用了 move_children_to() 并且想知道是否有类似的东西可以选择孩子。

【问题讨论】:

    标签: moovweb tritium


    【解决方案1】:

    有几种不同的方法可以选择直系子级。

    首先你可以这样做:

    $("./*") {
      # code for children goes here.
    }
    move_children_to("..", "after)
    

    另一种处理方法是在move_children_to() 上打开一个范围

    move_children_to("..", "after) {
      # children code can go here.
    }
    

    我希望这会有所帮助!让我知道我是否可以提供更多帮助。

    【讨论】:

    • 太棒了。感谢您的帮助!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-02-09
    • 1970-01-01
    • 1970-01-01
    • 2014-07-06
    • 2011-06-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多