Back on topic...

It creates a new class/object representing the class names. The class
is called Element.ClassNames and it is extended by Enumerable. That
means you can iterate through the element's class names. Pretty cool.

On 8/14/06, William Attwood <[EMAIL PROTECTED]> wrote:
It looks to me like it creates a new element of that classname.  Oh,
off-topic a little bit, if you guys are interested, a friend of mine made
some tweaks to prototype, check out www.beauscott.com for info.

--Will

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sam
Sent: Monday, August 14, 2006 10:55 AM
To: rails-spinoffs@lists.rubyonrails.org
Subject: [Rails-spinoffs] OK. I'm confused again.


Prototype.js can be humbling.  Just when I think I've got a handle on how to
read inside-out, I find something I've never seen before and can't get my
head around.

I am chasing down a bug in my code which uses Element.classNames, so I
wandered off in prototype.js to see how classNames worked.

Contest: Explain clearly, with the fewest possible words, how this function
works:


Element.Methods = {

// other methods appear here

  classNames: function(element) {
    return new Element.ClassNames(element);
  },





_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

--
Internal Virus Database is out-of-date.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.7/410 - Release Date: 8/5/2006


--
Internal Virus Database is out-of-date.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.7/410 - Release Date: 8/5/2006


_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to