应该做的一件非常简单的事情就是让自己变得非常艰难。切换模态的简单方法不适用于javascript。这是代码:
<div class="modal1 mfp-hide" id="modal-signup">
<div class="block divcenter" style="background-color: #FFF; max-width: 400px;">
<div style="padding: 50px;">
<h3 class="font-body">Signup for an account</h3>
<div class="help-block with-errors has-errors" id ="signupError"></div>
<form action="#" id="signup_modal" method="post" class="nobottommargin">
<div class="form-process"></div>
<div class="col_full">
<label class="font-body capitalize" for="signup-form-modal-name">Name:</label>
<input type="text" id="signup_form_modal_name" name="signup-form-modal-name" value="" class="form-control" required />
</div>
<div class="col_full">
<label class="font-body capitalize" for="signup-form-modal-username">Email:</label>
<input type="text" id="signup_form_modal_username" name="signup-form-modal-username" value="" class="form-control" required />
</div>
<div class="col_full">
<label class="font-body capitalize" for="signup-form-modal-password">Password:</label>
<input type="password" id="signup_form_modal_password" name="signup-form-modal-password" value="" class="form-control" required />
</div>
<div class="col_full">
<label class="font-body capitalize" for="signup-form-modal-password">Repeat Password:</label>
<input type="password" id="signup_form_modal_repassword" name="signup-form-modal-repassword" value="" class="form-control" required />
</div>
<div class="col_full">
<label class="font-body capitalize" for="signup-form-modal-mobile">Mobile:</label>
<input type="text" id="signup_form_modal_mobile" name="signup-form-modal-mobile" value="" class="form-control" required />
</div>
<div class="col_full nobottommargin">
<button class="button button-rounded nomargin" id="signup_form_modal_submit" name="signup-form-modal-submit" value="signup">Signup</button>
</div>
</form>
<div class="line line-sm"></div>
<a href="#" class="button button-rounded btn-block t400 center capitalize si-facebook si-colored noleftmargin norightmargin">Signup with Facebook</a>
<a href="#" class="button button-rounded btn-block t400 center capitalize si-gplus si-colored nomargin">Signup with Google</a>
</div>
</div>
$("#signup_form_modal_submit").click(function(e){
$.post("<?php echo BASE_URL.'/login/register';?>", $('#signup_modal').serialize(),function(data){
if(data['a']==1){
$("#modal-signup").modal('toggle');
//$("#modal-signup").modal('hide');
//$("[data-dismiss=modal]").trigger({ type: "click" });
}
}
});
任何js都没有问题,因为其他一切正常。即使单击此模式的关闭按钮也会关闭这个问题,似乎问题仅在于js。
我想要关闭这个模态并打开另一个模态。任何人都可以帮忙吗?
答案 0 :(得分:0)
试试这个:
findById