implementing array.not
HTML
<div ></div>
<div ></div>
<div ></div>
<div class="red" ></div>
<div ></div>
CSS
div {
background: green;
height: 30px;
}
div.red {
background: red;
}
JavaScript
Array.implement({
not: function(skipEl) {
return skipEl ? this.filter(function(el) {
return el != skipEl;
}) : this;
}
});
var divs = document.getElements("div");
var redDiv = document.getElement("div.red");
divs.not(redDiv).fade(.2);