`
leejian
  • 浏览: 27081 次
  • 性别: Icon_minigender_2
  • 来自: 北京
社区版块
存档分类
最新评论

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%;}修改为任意的大小
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics