mootools
Update: I've added the "match" option to the getSiblings() method.
更新:我已经将“ match”选项添加到getSiblings()方法中。
While browsing through the open tickets at the MooTools LightHouse, I found this little gem proposed by SixtyMonkey:
浏览MooTools LightHouse的开放门票时,我发现了SixtyMonkey提出的这个小宝石:
Element.implement({
getSiblings: function(match,nocache) {
return this.getParent().getChildren(match,nocache).erase(this);
}
});
The above code grabs all sibling elements (the collection of alike elements minus the "found" one.) Do you think this should be added to the core?
上面的代码捕获了所有同级元素(相似元素的集合减去“找到的”元素。)您是否认为应该将其添加到核心中?
I submitted this to core and it has been accepted. Look forward to seeing this in core!
我将此提交到核心,并且已被接受。 期待在核心中看到这一点!
mootools