Bootstrap 模式:关闭当前,打开新 [英] Bootstrap modal: close current, open new

查看:39
本文介绍了Bootstrap 模式:关闭当前,打开新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经找了一段时间,但我找不到解决方案.我想要以下内容:

I have looked for a while, but I can't find a solution for this. I want the following:

  • 在 Bootstrap 模式中打开一个 URL.我有这个工作.所以内容是动态加载的.
  • 当用户按下此模式中的按钮时,我希望隐藏当前模式,然后立即使用新 URL(用户单击的 URL)打开一个新模式.第二个模态的内容也是动态加载的.
  • 如果用户随后关闭了第二个模态,则第一个模态必须再次返回.

我已经盯着这个好几天了,希望有人能帮助我.

I have been staring at this for days, hope someone can help me.

提前致谢.

推荐答案

不看具体代码,很难给你准确的答案.但是,从 Bootstrap 文档中,您可以像这样隐藏模式:

Without seeing specific code, it's difficult to give you a precise answer. However, from the Bootstrap docs, you can hide the modal like this:

$('#myModal').modal('hide')

然后,在隐藏后显示另一个模态:

Then, show another modal once it's hidden:

$('#myModal').on('hidden.bs.modal', function () {
  // Load up a new modal...
  $('#myModalNew').modal('show')
})

您将不得不找到一种方法将 URL 推送到新的模式窗口,但我认为这很简单.如果没有看到代码,很难给出一个例子.

You're going to have to find a way to push the URL to the new modal window, but I'd assume that'd be trivial. Without seeing the code it's hard to give an example of that.

这篇关于Bootstrap 模式:关闭当前,打开新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆