使用 Eric Martin 的 SimpleModal 从模态中打开模态
我正在使用 Eric Martin 的 SimpleModal 为项目创建模态,我遇到了一种情况,我需要在已经打开的模态之上打开第二个模态。有谁知道我怎样才能实现这一目标?
I'm using SimpleModal by Eric Martin to create modals for a project, and I have a situation where I need to open a second modal on top of a modal that I already have open. Does anybody know how I can achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Eric Martin,可以更好地回答(我知道他使用 SO 作为他的技术支持场所),但我相当确定 SimpleModal 是一个仅单实例的插件。我这样说是因为创建一个覆盖层 (div) 是为了在页面上容纳多个对话,并且一次不能显示多个对话。
证明: http://jsfiddle.net/QtbQQ/2/
为了适应对话中的对话,我'我想您需要大量修改这个插件。
例如:
$.modal.close()
;需要更新以针对特定的模式对话。简而言之,这一切看起来很有可能,但这个插件肯定不支持它。
也许你可以制作一个原型,看看埃里克是否会添加它!
Eric Martin, could answer better (I know he uses SO as his tech support venue), but I'm fairly certain that SimpleModal is a single instance only plugin. I say this because a single overlay (div) is created to accommodate multiple dialogues on a page, and you can not display more than one dialogue at a time.
Proof: http://jsfiddle.net/QtbQQ/2/
To accommodate dialogues within dialogues, I'd imagine that you'd need to heavily modify this plugin.
For instance:
$.modal.close()
; Need update to target specific modal dialogues.In short, this all seems very possible, but it is certainly not supported by this plugin as is.
Perhaps you could put a prototype together and see if Eric would add it in!
围绕它有一个“黑客”:
此外,Eric 提到了我无法理解的“持久”,但据我所知,它与保持 DOM 相关内容在模态中持久存在有关。在本例中,
modal( { persist:true } )
。There is a "hack" around it:
Also, Eric mentions the "persist" which I haven't being able to understand but, for what I could gather, it has to do with keeping DOM related stuff persistent across modals. In this case,
modal( { persist:true } )
.