In any event, the how to...
------------------
YUI 2
var _d = YAHOO.util.DOM;
var aElements = _d.getElementsByClassName('className');
var i = aElements.length;
while(i--){
doSomething(aElements(i));
}
------------------
YUI 3
YUI().use('node', function(Y){
var aElements = Y.all('div.selector');
var i = aElements.size();
while(i--){
doSomething(aElements.item(i));
}
}
------------------
Note the "size" call as opposed to "length" and the "item(i)" in the "doSomething" call. Ouch.
I love YUI and have been a huge fan of Crockford, Glass, Eric, Nate and the rest of the crew over there but DUDES! C'MON! jk ;)
I finally came to grips after finding the "Rosetta Stone." Have a look and good luck!
No comments:
Post a Comment