DojoToolkit AccordionContainer

2019-08-24 19:46发布

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.

标签: dojo
1条回答
老娘就宠你
2楼-- · 2019-08-24 20:11

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

查看更多
登录 后发表回答