I was looking for the answer to exactly this problem and was able to
get some help in another forum:
http://www.mooforum.net/solutions12/accordion-mouseenter-mouseleave-help-t3312.html
Toggler changes color on hover and changes color when selected.
Here is the solution:
window.addEvent('domready', function() {
var myAccordion = new Accordion($('accordion'), 'h3.toggler',
'div.element', {
display: -1,
opacity: true,
alwaysHide: true,
onActive: function(toggler, element){
toggler.setStyle('color', '#0D4D95');
//remove the toggler hover events to clear out its events
when it was inactive
toggler.removeEvents('mouseenter');
toggler.removeEvents('mouseleave');
//then add your events again
toggler.addEvent('mouseenter',function()
{
});
},
onBackground: function(toggler, element){
toggler.setStyle('color', '#666');
//remove the toggler hover events to clear out its events
when it was active
toggler.removeEvents('mouseenter');
toggler.removeEvents('mouseleave');
//then add your events again
toggler.addEvent('mouseenter',function()
{this.setStyle('color', '#000');
toggler.addEvent('mouseleave',function()
{this.setStyle('color', '#666');
});
});
}
});
});