Implementing Element.getSiblings() in mootools1.1
Saturday, June 27, 2009 23:43No Comments
I found a nice mootools code in David Walsh’s Blog. This code gathers all the siblings of an element but this code is compatible with mootools1.2 and above. I have modified the code a little to implement it in mootools1.1. Why mootools 1.1? because Joomla1.5 still uses mootools1.1. (Joomla1.6 will have mootools1.2). So here is the little modification of the code as presented by David Walsh.
Element.extend({
getSiblings: function() {
return this.getParent().getChildren().remove(this);
}
});
Yes, this small code gathers all the siblings of the element except for itself. Isn’t it simple?
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.















