Bootstrap为模态框添加滚动条

Bootstrap为模态框添加滚动条

转载至bootstrap模态框加滚动条的方法, 在html文件的<style>...</style>标签中加上如下代码即可:

<style type="text/css">
    .modal-dialog {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
    }

    .modal-content {
        /*overflow-y: scroll; */
        position: absolute;
        top: 0;
        bottom: 0;
        width: 100%;
    }

    .modal-body {
        overflow-y: scroll;
        position: absolute;
        top: 55px;
        bottom: 65px;
        width: 100%;
    }

    .modal-header .close {margin-right: 15px;}

    .modal-footer {
        position: absolute;
        width: 100%;
        bottom: 0;
    }
</style>

<body>
   ...
         
    <button type="button" data-toggle="modal" data-target="#myModal" class="btn btn-primary mr5" style="margin-top:5px">
        Finish
    </button>
                      
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">数据预览</h4>
                </div>
                <div class="modal-body">
                    <table id="basicTable" class="table table-striped table-bordered responsive">
                        <thead class="">
                            <tr>
                                <th v-for="(head,index) in analysis_columns" v-text="head"></th>
                            </tr>
                        </thead>

                        <tbody>
                            <tr v-for="(row,index_i) in analysis_values">
                                <td v-for="(column,index_j) in row" v-text="column"></td> 
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="modal-footer">
                    <button type="reset" class="btn btn-default" data-dismiss="modal">重置</button>
                    <button type="submit" class="btn btn-primary" v-on:click="submitForm()">提交</button>
                </div>
            </div>
        </div>
    </div>
</body>
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值