Javascript

Using mootools (not the action), the naming scheme for accordions must
use classes ‘.toggler’ and ‘.element’. I can style these classes and
everything works but here’s where I’m stumbling: I need to style
different accordions, well, differently and using the above classes
for everything doesn’t work, visually. So my question is how do assign
different classes so moo recognizes that, for example, ‘.new_class’ is
a valid class, the same as ‘toggler’?

Todd

Here’s the basic accordion js:

window.addEvent('domready', function() {

    //create our Accordion instance

    var myAccordion = new Accordion($('accordion'), '.toggler',  
'.element', {
		display: -1,
		alwaysHide: true,
		opacity: true,
    });
});

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

It looks like you just pass the classnames as arguments to the
constructor call. So if you had already made one accordion using the
code you posted above, you would make the next one like this:

window.addEvent('domready', function() {

   //create our Accordion instance

   var myNewAccordion = new Accordion($('newAccordion'),  
'.newToggler', '.newElement', {
		display: -1,
		alwaysHide: true,
		opacity: true,
   });
});

You can’t use the same names for two different accordion effects,
otherwise a click in one would affect all accordions on the same page.
And you can’t use the same ID for two different accordions because IDs
have to be unique on the page.

Walter

On Aug 16, 2009, at 5:11 PM, Todd wrote:

Using mootools (not the action), the naming scheme for accordions
must use classes ‘.toggler’ and ‘.element’. I can style these
classes and everything works but here’s where I’m stumbling: I need
to style different accordions, well, differently and using the above
classes for everything doesn’t work, visually. So my question is how
do assign different classes so moo recognizes that, for example,
‘.new_class’ is a valid class, the same as ‘toggler’?


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