bootstrap模态框弹出位置设置

<div class="modal fade modal_position" id="myModal" tabindex="-1" style="min-width:275px;">
    <div class="modal-dialog modal-sm">
        <div class="modal-content skill-group-content">
            <button type="button" class="close skill_group_close" aria-label="Close"
data-dismiss="modal" aria-hidden="true">
                &times;
</button>
            <div class="modal-body">
                <div class="modal-body-type">
                    <label class="webchat" for='webchat_topeer'>选择技能组</label>
                    <select class="webchat" id='webchat_topeer'></select>
                </div>
                <div class="modal-body-type">
                    <label class="webchat" for='type_name'>类型名称</label>
                    <input class="webchat" type='text' id='type_name' required>
                </div>
                <div class="modal-body-type">
                    <label>启用咨询类型</label>
     <input id="webchat_showTypeName" style="width:20px; height:20px;" type="checkbox" value="true" name="webchat_showTypeName" checked="checked">
                </div>

                <button type="button" class="btn-small btn-position ds_do_action" ds_action="config.channel.addSkillGroup">
                    确定
</button>
            </div>

        </div><!-- /.modal-content -->
</div>
</div>
<script>
$('#myModal').modal().css({
     'margin-top': function () {
         return ($(this).height() * 1.5);
     }
 });
</script>
使用jquery通过在css样式中设置margin-top的值得大小可以改变距离顶端的距离。也可以在style中修改
div.modal.fade.in{top:10%;}修改为任意的大小
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值