Daniel Eben Elmore a écrit :
Ah, yes that code looks like it would check an element
individually/explicitly. I think? But what about returning all elements in
the document as an array like the getElementsByClassName function does? I
suppose I could just modify the function, but didn't know if there was a
more elegant way.
This could be stuff for a nice patch. I might look into it soon. In
the meantime, can't you reorganize your classes so that instead of using
the structure of a single class name to categorize them, you treat class
names as aspects, and equip the relevant element with several class
names, some being used only for such retrieval?
e.g. instead of:
<elt1 class="toggledItem">...</elt1>
<elt2 class="item">...</elt2>
...
<elt3 class="toggledBar">...</elt3>
-> document.getElementsByClassName(/^toggled/); // doesn't work
you'd go:
<elt1 class="toggled item">...</elt1>
<elt2 class="item">...</elt2>
...
<elt3 class="toggled bar">...</elt3>
-> document.getElementsByClassName('toggled'); // works fine
--
Christophe Porteneuve a.k.a. TDD
"[They] did not know it was impossible, so they did it." --Mark Twain
Email: [EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on
Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---