Target Class

Currently I have a div (#logo) set to fade in using Moo but I want to
get rid of the div and target a text style instead (h1.logo).

I’m pretty sure I’ve done this before but I can’t remember and it
seems so simple. View the current js here, http://pastie.org/505718

Todd


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Try this:

http://pastie.org/505865

I’ve never used Moo before, but it descends from the mountains of
Prototype, so it seems like this would work. In Prototype, you would
have to say $$(‘h1.logo’).invoke(‘fadeOnLoad’,
2600,‘Fx.Transitions.linear’) to apply a single method to all of the
members of a collection, but that’s just how things work there.
According to the documentation here: http://mootools.net/blog/2007/10/31/mootools-foundations-natives-and-elements/
Moo is quick enough to figure out that it’s been passed an array and
act on each member of that array rather than the array itself.

If you’re curious why the accessor would be $$() rather than $() when
dealing with a classname, then recall that classnames are not page-
unique, while IDs are. So when you request AN element by ID, you
always get only one (from a valid page, anyway). When you request a
CLASS you get 0 or 1 or Many such elements, always in an array.

Walter

On Jun 9, 2009, at 10:08 AM, Todd wrote:

Currently I have a div (#logo) set to fade in using Moo but I want
to get rid of the div and target a text style instead (h1.logo).

I’m pretty sure I’ve done this before but I can’t remember and it
seems so simple. View the current js here, http://pastie.org/505718

Todd


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks Walter, I tried your suggestion but no luck. I’ll have to spend
more time picking through the Moo docs.

Todd

On Jun 9, 2009, at 11:09 AM, Walter Lee Davis wrote:

I’ve never used Moo before, but it descends from the mountains of
Prototype, so it seems like this would work. In Prototype, you would
have to say $$(‘h1.logo’).invoke(‘fadeOnLoad’,
2600,‘Fx.Transitions.linear’) to apply a single method to all of the
members of a collection, but that’s just how things work there.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options