DojoToolkit AccordionContainer

心不动则不痛 提交于 2019-12-24 19:19:06

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/917703/dojotoolkit-accordioncontainer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!