Bootstrap使用后笔记

 2023-09-05 阅读 33 评论 0

摘要:Bootstrap Modal 垂直居中 在 bootstrap.js中修改如下代码: Modal.prototype.adjustDialog = function () { var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight this.$element.css({ paddingLeft: !this.

 

Bootstrap Modal 垂直居中 在 bootstrap.js中修改如下代码:

Modal.prototype.adjustDialog = function () {

var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight

 

this.$element.css({

paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',

paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''

})

// 是弹出框居中。。。

var $modal_dialog = $(this.$element[0]).find('.modal-dialog');

var m_top = ( $(window).height() - $modal_dialog.height() )/2;

$modal_dialog.css({'margin': m_top + 'px auto'});

}

 

Bootstrap Model点击空白处 popup会关闭:

增加属性 data-backdrop="static"

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/5/1442.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息