bootstrap 模态窗口点击图层不关闭写法

<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
    String path = request.getContextPath();
            String basePath = request.getScheme() + "://"
                    + request.getServerName() + ":" + request.getServerPort()
                    + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

<head>

<!--适应手机显示-->

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">

</style>
<script type="text/javascript" src="lib/bootstrap/js/jquery.min.js"></script>
<script type="text/javascript" src="lib/bootstrap/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="lib/bootstrap/utilLib/bootstrap.min.css" type="text/css" media="screen" />

<script>
  $(document).ready(function () {
      $("#apply").click(function () {
            $.ajax({url:'填写你的请求地址',
                type : 'post',
                data : $("#form1").serialize(),//取得所有表单内容
                dataType : 'json',
                success : function(data) {
                 
                    if (data.code == 100) {
                        $("#title").html("成功");
                    }
                    else {
                        $("#title").html("失败");
                    }
                    $("#msg").html(data.msg);
                    $("#submit").click();//触发模态窗口
                }
            });
        });
    });
</script>
</head>
<body style="padding: 10% 5% 5% 5%">
    <center>
        <s:form id="form1" action="apply_secretkey" method="post"   namespace="/payment/appstore">
            <table width="100%" border="0">
                <tr>
                    <td>

                        <div>

<!--大字体-->

                            <input type="text" name="tel"  placeholder="Number" class=" input-lg form-control"/><br>
                        </div>
                        <br>
                    </td>
                </tr>
                <tr>
                    <td width="100%">

                        <div>

<!--大字体-->

                            <button type="button" id="apply"   class="btn  btn-block  btn-lg btn-info">点击</button>   
                        </div>
                    </td>
                </tr>
            </table>

        </s:form>
    </center>

    <!-- 按钮触发模态框 -->

    <div style="display: none">

<!--指定一个静态的背景,当用户点击模态框外部时不会关闭模态框。-->

        <button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal" id="submit" data-backdrop="static"></button>
    </div>
    <!-- 模态框(Modal) -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <em id="title"> </em>
                </div>
                <div class="modal-body">
                    <em id="msg"></em>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                </div>
            </div>
        </div>
</body>
</html>
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值