欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Bootstrap 模态框使用

程序员文章站 2023-12-30 13:17:22
...
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <meta charset="utf-8" />
    <script src="../Content/js/jquery/jquery-2.1.1.min.js"></script>
    <link href="../Content/css/bootstrap.css" rel="stylesheet" />
    <script src="../Content/js/bootstrap/bootstrap.min.js"></script>
<style>
    .modal-dialog {
        left: -3%;
        top: 150px;
    }
</style>

</head>
<body>
<script type="text/javascript">
        $(function () {
            $("#alertmodel").click(function () {
                $('#myModal').modal();
            })
        })
</script>
<button id="alertmodel" class="btn btn-primary btn-lg" data-toggle="modal">开始演示模态框</button>
<!-- 模态框(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">×</button>
                <h4 class="modal-title" id="myModalLabel">模态框(Modal)标题</h4>
            </div>
            <div class="modal-body">点击关闭按钮检查事件功能。</div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary">提交更改</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div>
</body>
</html>

 

上一篇:

下一篇: