解决方法
我这样做的另一种方式(不是很好,因为我覆盖了一个私有方法,但它给了我我想要的灵活性):
var d = new Dialog({ title:"Your Dialog",_position:function(){ if(this.refNode){ p = Geo.position(this.refNode); Style.set(this.domNode,{left:p.x + "px",top:p.y + "px"}); } },showAround:function(node){ this.refNode = node; this.show(); } }); d.showAround(dojo.byId("someNode"));
这个例子使用“dojo / dom-style”作为Style,使用“dojo / dom-geometry”作为Geo.