modal的远程加载,modal无法自动调整大小,会占据整个页面

_hyimn
  • -2
新手上路,请多包涵

modal远程加载,modal无法自动调整大小,会占据整个页面

modal.jsp

<!DOCTYPE html>
<html>
<head>
<title>modal.html</title>
<link href="common/assets/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript"
    src="common/assets/js/jquery-2.0.3.min.js"></script>
<script src="common/assets/js/bootstrap.min.js"></script>

</head>

<body>

    <button class="btn btn-primary btn-lg" data-toggle="modal"
        data-target="#myModal" href="test.html">开始演示模态框</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">&times;</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 -->
    </div>
</body>
</html>

test.jsp

<div class="modal-header">

    <button type="button" class="close" data-dismiss="modal"
        aria-hidden="true">&times;</button>

    <h4 class="modal-title" id="myModalLabel">药品出库</h4>

</div>
<div class="modal-body">
    543223898765
</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>

图片描述

图片描述

回复
阅读 3.3k
1 个回答
_hyimn
  • -2
新手上路,请多包涵
✓ 已被采纳

修改后的test.jsp

<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>

            <h4 class="modal-title" id="myModalLabel">药品出库</h4>

        </div>
        <div class="modal-body">
            <div class="container-fluid">
                <div class="col-sm-1">321</div>
            </div>
        </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>
</div>
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏