Hi,
It may be a little slower as says Victor.
However, you may try to use part of the class to identify a
"plugin"class and the other part for identifying the JS class to use.
Something like that:
$$("*[class^='plugin']).each(function(e) {
var jsClass = e.className.substr(6);
if(typeof(window[jsClass])=='function') new (window[jsClass])(e);
});
if you have an UL with class pluginTabs, it will make a "new Tabs(e)"
on it.
Note that the above code is not tested at all. You may need to found a
proper way to check if the class actually exists and you may need to
use another selector operator than ^= since classes are space
separated sets (sorry, I don't have time to check the documentation).
On a ground to earth approach, I'd continue doing what you're doing
right now.
Only difference perhaps is that I'd add to my plugin classes a static
method which do the selection and DOM update, so you can give an array
of class objects to your DOM init and invoke it.
Eric