MochaUI is an excellent UI library in Mootools, the simplicity is overwhelming and on top of it all the dynamic pseudo selectors as lately mentioned in David Walsh's blog... amazing.
/* grab "checked" elements */
Selectors.Pseudo.checked = function() {
return ('input' == this.get('tag') && ('radio' == this.get('type') || 'checkbox' == this.get('type')) && this.checked);
};
/* grab "selected" option elements */
Selectors.Pseudo.selected = function() {
return ('option' == this.get('tag') && this.selected);
};
/* grab random elements */
/* credit: http://blog.kassens.net/custom-pseudo-selectors */
Selectors.Pseudo.random = function(probability, local) {
return Math.random() < (probability || .5).toFloat();
};
/* grab elements with no value */
Selectors.Pseudo.noValue = function() {
return '' === this.value;
}
/* grab elements with a specific empty attribute */
Selectors.Pseudo.emptyAttribute = function(att) {
return this.get(att) == '';
}
i think i might have some second thoughts about JQuery..
MooTools is much richer than jQuery in my opinion.
ReplyDeleteHowever, you can do the same pseudo selectors in jQuery too.
Look at:
http://ajaxian.com/archives/extending-jquery-selectors-with-javascript
http://james.padolsey.com/javascript/extending-jquerys-selector-capabilities/
nice to know, didn't check it up yet (tangled up with mootools as the current project, maybe next time).
ReplyDelete