ALRIGHT!!! Found a blog post of an easy way to induce hover over the toggler element:
Code:
//make the accordion
var accordion = new Accordion($$('.toggler'),$$('.element'), {
opacity: 0,
onActive: function(toggler) { toggler.setStyle('color', '#f30'); },
onBackground: function(toggler) { toggler.setStyle('color', '#000'); }
});
//make it open on hover
$$('.toggler').addEvent('mouseenter', function() { this.fireEvent('click'); });
That is the original code from the blog site http://davidwalsh.name/mootools-accordion-hover-event
Now to make it work with Contao, this is what the input will be in moo_accordion.tpl:
Code:
<script type="text/javascript">
<![CDATA[//><!--
window.addEvent('domready', function() {
var accordion = new Accordion($$('.toggler'),$$('.accordion'), {
opacity: 0,
onActive: function(toggler) { toggler.setStyle('color', '#f30'); },
onBackground: function(toggler) { toggler.setStyle('color', '#000'); },
display: false,
});
$$('div.toggler').addEvent('mouseenter', function() { this.fireEvent('click'); });
});
//--><!]]>
</script>
The code works beautifully!
Bookmarks