最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to set the location a Dojo Dialog opens at? - Stack Overflow

programmeradmin1浏览0评论

I have a Dojo dialog that is opened when a user clicks on an element on the page.

I want control the location it opens at ....really I want it to open beside (relative to) the other dom element clicked on.

But I can seem to figure out how to do either of the above.

Thank for any advice.

I have a Dojo dialog that is opened when a user clicks on an element on the page.

I want control the location it opens at ....really I want it to open beside (relative to) the other dom element clicked on.

But I can seem to figure out how to do either of the above.

Thank for any advice.

Share Improve this question asked Jun 18, 2012 at 4:03 Gern BlanstonGern Blanston 42.7k19 gold badges52 silver badges64 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 3

Open an dialog with dojo relative to click position:

dojo.style(pointDialog.domNode, 'visibility', 'hidden');
pointDialog.show().then(function () {
    dojo.style(pointDialog.domNode, 'top', clickEvt.pageY);
    dojo.style(pointDialog.domNode, 'visibility', 'visible');
});

The visibility trick is needed for dialog not hop

I'd take a loot at the Tooltip doc for Dojo. I've never had experience with Dojo, but here are some links that should help you get started.

Dojo Dijit Dialog relative position. is it possible?

http://livedocs.dojotoolkit/dijit/TooltipDialog

http://mail.dojotoolkit/pipermail/dojo-interest/2011-May/054581.html

发布评论

评论列表(0)

  1. 暂无评论