>
> I've been attempting to test with code such as
>
> $$('#homeaccordion .toggler').addEvent('click', function() {
> var zindex = this.get('class');
> if (zindex == "toggleractive") { alert(zindex); };
> };
>
> Which, hopefully, should get the classes for me. Then, check if one of
> those classes is 'toggleractive', and then if it is, alert me that it is in
> fact working.
>
> However, I can't seem to get that to work.
>
I don't see anything wrong with the code above (unless your selector -
#homeaccordion .toggler - is not returning anything). Are you doing this
after domready?
Also, the example above is missing a closing ) on the last line, but I'm
guessing that's not the case in your actual code or you'd get a parse error.
You should consider logging things to the console (firebug) to inspect them
and see if what you think is going on really is:
$$('#homeaccordion .toggler').addEvent('click', function() {
console.log('click!', this);
var zindex = this.get('class');
console.log('class: ', zindex);
if (zindex == "toggleractive") { alert(zindex); };
});
This way you'll know which part is failing and why.
-----
The MooTools Tutorial: http://www.mootorial.com www.mootorial.com
Clientcide: http://www.clientcide.com www.clientcide.com
--
View this message in context:
http://n2.nabble.com/A-little-mootools-guidance-%28Styles%2C-Multiple-Animations%2C-Conditional-Statements%29.-tp2954347p2954487.html
Sent from the MooTools Users mailing list archive at Nabble.com.