zoukankan      html  css  js  c++  java
  • 解决bootstrap模态框居中问题

    完美解决办法:

      在bootstrap.js或bootstrap.min.js文件中找到Modal.prototype.show方法。

      在that.$element.addClass('in').attr('aria-hidden', false)代码前加入下面这段代码。

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

    运行结果;

     亲测有效,特此记录。而且此方法也能解决bootbox无法居中的问题。

      

  • 相关阅读:
    openssh的服务端配置文件
    SSH的端口转发
    ssh服务
    文件引入
    数据类型的转换
    作用域
    静态变量
    函数
    php嵌入html的解析过程
    PHP执行过程
  • 原文地址:https://www.cnblogs.com/wutongvip/p/11442259.html
Copyright © 2011-2022 走看看