如果要关闭模式弹出窗口,我想重定向特定页面。我的代码将在下面提及:
<div class="modal fade" id="logint-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header" align="center">
<img class="" id="img_logo" src="logo.jpg">
</div>
<div id="div-forms" style="margin:20px 0 20px;">
<p class="text-center">
<!--<img src="https://image.flaticon.com/icons/png/512/19/19973.png" class="img-responsive center-block" height="50px" width="50px">-->
</p>
<p class="text-center">
<?php echo Email/Mobile already exist;?>
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default modal_close" data-dismiss="modal">Okay</button>
</div>
</div>
</div>
Jquery代码:
<script type="text/javascript">
$(document).ready(function() {
$(".modal_close").bind("click", function() {
window.location.href = "login.php";
});
});
</script>
请解决我的问题,以上代码无效。
您可以使用hide.bs.modal
实现您的目标: