Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

Sunday, May 16, 2010

iPhone Unit Conversion Calculator

So, I dove into jQuery and jQTouch development for the iPhone and all I know is, I can't wait to do it again.

Wow, wow, wow... talk about easy-peasy-Japanese. I could not have been more impressed. The functionality of the unit conversion calculator in-and-of-itself is nothing to write home about BUT, that which comes with employing jQuery + jQTouch most certainly is.

Wowsers. Yep. That's all I got. Wowsers.

The iPhone app includes four conversion calculators - a length converter, liquid converter, temperature converter, and time converter. From your iPhone, check out the converter here: iPhone Unit Conversion Calculator.

Don't forget to add it as a full screen app by hitting the + sign. :)

 

Tuesday, April 06, 2010

YUI 3: Looping through an array of elements

OH MAN... I was about ready to kill somebody over this one. Being a die-hard YUI2'er, the concepts introduced in YUI 3, while possibly familiar to the jQuery crowd, are COMPLETELY foreign to us YUI 2 jedis.

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!