我正在尝试加快或删除Dojo中标题窗格的wipeIn和wipeOut动画。单击标题栏后,内容应立即显示。在其他框架中,我会修改动画的速度或持续时间,但是到目前为止,在dojo中我还没有运气。我也尝试过覆盖动画,但没有太大的成功。
这是(简化)我创建TitlePane的方法:
require(["dijit/TitlePane", "dojo/dom-construct"], function(TitlePane, domConstruct){
var titlePaneOptions = {};
titlePaneOptions.title = "Some Title";
titlePaneOptions.open = true;
titlePaneOptions.content = "Content";
this._titlePane = new TitlePane(titlePaneOptions);
domConstruct.place(this._titlePane.domNode, this.context.element, "only");
this._titlePane.startup();
});
最佳答案
检查API文档中的TitlePane,在“属性摘要”下有一个duration
:
持续时间-淡入/淡出的时间(以毫秒为单位)
因此,例如:
var titlePaneOptions = {};
titlePaneOptions.title = "Some Title";
titlePaneOptions.open = true;
titlePaneOptions.content = "Content";
titlePaneOptions.duration = 0;
..应该立即使其显示/消失。