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

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

问题描述

我已经看了一会儿,但我找不到解决方案。我想要以下内容:

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


  • 在Bootstrap模式中打开一个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天全站免登陆