即使出现dijit.dialog,也可以访问网页(Keeping access to the web page even when dijit.dialog appears)

编程入门 行业动态 更新时间:2024-10-27 13:35:12
即使出现dijit.dialog,也可以访问网页(Keeping access to the web page even when dijit.dialog appears)

我面临的问题是,当我激活dijit.dialog()时,网页模糊,我无法连接页面,直到我关闭对话框。 有什么方法可以让对话框保持打开状态并仍然可以访问页面。 通过访问我的意思是网页应该能够听取点击事件或类似的事情。 如果没有,我可以使用其他工具吗?

Problem I am facing is that when I activate the dijit.dialog(), the webpage blurs and I can not connect with the page till I close the dialog box. Is there some way that I can keep the dialog box open and still access the page. By access I mean that the webpage should be able to listen to click events or things like that. If not is there some other tool that I can use?

最满意答案

考虑dojox/layout/FloatingPane因为dijit/Dialog非常硬连接为模态(通过单例):

// var FloatingPane = require("dojox/layout/FloatingPane"); var floatingPane = new FloatingPane({ title: "FloatingPane", content: "Hello World!", resizable: false, dockable: false }, "floatingPane"); floatingPane.startup();

或者如果你坚持使用dijit/Dialog你可以继承它,但是期待可能的奇怪的东西,尤其是。 嵌套和/或组合模态/非模态对话框时:

// var Dialog = require("dijit/Dialog"); var ModelessDialog = declare(Dialog, { show: function() { this.inherited(arguments); Dialog._DialogLevelManager.hide(this); } });

在jsFiddle中看到它的运作: http : //jsfiddle.net/phusick/TgEWL/

注意:在使用FloatingPane.时,不要忘记包含dojox / layout / resources / FloatingPane.cssdojox / layout / resources / ResizeHandle.css样式表FloatingPane.

Consider dojox/layout/FloatingPane because dijit/Dialog is quite hard-wired to be modal (via singletons):

// var FloatingPane = require("dojox/layout/FloatingPane"); var floatingPane = new FloatingPane({ title: "FloatingPane", content: "Hello World!", resizable: false, dockable: false }, "floatingPane"); floatingPane.startup();

or if you insist on dijit/Dialog you can subclass it, but expect possible weird stuff, esp. when nesting and/or combining modal/non-modal dialogs:

// var Dialog = require("dijit/Dialog"); var ModelessDialog = declare(Dialog, { show: function() { this.inherited(arguments); Dialog._DialogLevelManager.hide(this); } });

See it in action at jsFiddle: http://jsfiddle.net/phusick/TgEWL/

N.B.: Do not forget to include dojox/layout/resources/FloatingPane.css and dojox/layout/resources/ResizeHandle.css stylesheets when using FloatingPane.

更多推荐

本文发布于:2023-08-02 15:54:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1378601.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:网页   Keeping   dijit   dialog   page

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!