当前位置:首页 >> 网络编程

bootstarp modal框居中显示的实现代码

bootstrap.js的大概1154行:

this.$element.css({
   paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing "htmlcode">
 // 是弹出框居中
  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'});
 }

P.S. 需要的东西每次都要查一遍太麻烦了。以后注意整理。

bootstarp modal框居中显示的实现代码

以上所述是小编给大家介绍的bootstarp modal框居中显示的实现代码,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!