Bootstrap模态框(modal)垂直居中

来源:互联网 发布:自学新概念英语 知乎 编辑:程序博客网 时间:2024/05/04 08:33

that.$element.children().eq(0).css("position", "absolute").css({          "margin":"0px",          "top": function () {              return (that.$element.height() - that.$element.children().eq(0).height()-40) / 2 + "px";          },          "left": function () {              return (that.$element.width() - that.$element.children().eq(0).width()) / 2 + "px";          }      });

在bootstrap.js文件900行后面添加如下代码,便可以实现垂直居中。


0 0
原创粉丝点击