1

I use sorting plugin. When I move element1 to some other element2, I need to iterate over all siblings of element2. How can I do that? Moreover, I need to get some custom data- attribute for each element.

John Smith
  • 1,204
  • 3
  • 22
  • 42

1 Answers1

2

Something like this (untested) should do the trick:

node.getParent().visit(function(n){
    // Access n.data.myAttr ...
});

or simply iterate over the node.getParent().children array.

mar10
  • 14,320
  • 5
  • 39
  • 64