tags:

views:

128

answers:

1

How easy is it to make AccordionContainer provided with Dojotoolkit to slide up and down On MouseHover of Title rather than onMouseClick of the title pane.

A: 

This is fairly straightforward, but involves connecting to the semi-private _buttonWidget property for each child pane, so I can't guarantee that future versions of the toolkit won't break it. That said, I've tested in with the version of Dojo 1.3 on AOL's CDN.

Basically, after you've called startup() on your AccordionContainer, you just iterate through its children and connect each child's _buttonWidget to an anonymous onMouseOver event handler:

aContainer.getChildren().forEach(function(child){ 
    dojo.connect(child._buttonWidget, "onMouseOver", function(){
        aContainer.selectChild(child);
    });
});

Full example is here

Ryan Corradini
@Ryan,Thank you very much for the answer. I switched to jQuery Accordion and was able to get it working quickly. I felt that dojotoolkit's AccordionContainer is an overkill.
Kalyan Ganjam
Yeah, Dojo's widgets sometimes have a tendency towards over-engineering. Anyway, glad you found a solution you're happy with.
Ryan Corradini