Bootstrap,v3.2.0模态框

Bootstrap(v3.2.0)模态框(modal)垂直居中方法:

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

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";
          }
      });