Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Jquery引导模式。。。如何从另一个模态对话框中打开另一个模态对话框_Javascript_Jquery_Ajax_Twitter Bootstrap_Dialog - Fatal编程技术网

Javascript Jquery引导模式。。。如何从另一个模态对话框中打开另一个模态对话框

Javascript Jquery引导模式。。。如何从另一个模态对话框中打开另一个模态对话框,javascript,jquery,ajax,twitter-bootstrap,dialog,Javascript,Jquery,Ajax,Twitter Bootstrap,Dialog,我有一个模式对话框,里面有一个表单供用户登录。如果用户尚未注册,则该模式对话框中会有一个链接,用于打开另一个模式对话框,其中包含注册表单。问题是这会引起冲突,看起来很奇怪。我想我需要先关闭登录表单模式对话框,然后再打开注册模式对话框 // the button to open the login modal dialog <button class="btn btn-primary btn-sm" data-toggle="modal" data-target="#login-dialog

我有一个模式对话框,里面有一个表单供用户登录。如果用户尚未注册,则该模式对话框中会有一个链接,用于打开另一个模式对话框,其中包含注册表单。问题是这会引起冲突,看起来很奇怪。我想我需要先关闭登录表单模式对话框,然后再打开注册模式对话框

// the button to open the login modal dialog
<button class="btn btn-primary btn-sm" data-toggle="modal" data-target="#login-dialog">
        Login
      </button>

//this button is inside the login modal dialog, a will open the registration modal dialog
'<button class="btn btn-primary btn-sm" data-toggle="modal" data-target="#registration-dialog">
        Register
      </button>
//打开登录模式对话框的按钮
登录
//此按钮位于登录模式对话框内,a将打开注册模式对话框
'
登记

您可以根据需要打开/关闭该对话框,甚至可以从另一个对话框中打开/关闭该对话框。使用此样式:

div.modal {
    display:none;
}
使用此html:

<button id="login">Login</button>
<div id="login_modal" class="modal">this is your login modal.
    <br/>
    <br/>
    <button id="register">Register</button>
</div>
<div id="register_modal" class="modal">this is your register modal.</div>
这是一个例子

$("#login").click(function () {
    $("#login_modal").dialog({
        modal: true
    });
});

$("#register").click(function () {
    $("#register_modal").dialog({
        modal: true
    });
    $("#login_modal").dialog("close");
});