zoukankan      html  css  js  c++  java
  • Boostrap 模态框 水平垂直居中问题

            var editorB = new UE.ui.Editor({ initialFrameHeight: 350, initialFrameWidth: 600 });
            editorA.render("ScienceContentA");
            editorB.render("ScienceContentB");
            $(function () {
                //$("#AddUpdateModalA").modal("hide").css({
                //    //top: 0,
                //    left:0,
                //    "margin-top": function () {
                //        //return -$(window).height()/2 + ($(window).height() - $(this).height()) / 2;
                //        return - ($(this).height() / 2)-70;
                //    },
                //    "margin-left": function () {
                //        return ($(window).width() - $(this).width())/2;
                //    }
                //});
                $('.modal').on('show.bs.modal', centerModals);
                $(window).on('resize', centerModals);
                //PageQuery();//分页查询数据
            });
            //模态框水平垂直居中函数
            function centerModals() {
                $('.modal').each(function (i) {
                    var top = -($(this).height() / 2) - 70;
                    var left = ( $ (window).width() - $(this).width()) / 2;
                    $(this).css("margin-top", top);
                    $(this).css("margin-left", left);
                });
            }
  • 相关阅读:
    Tomcat服务器原理详解
    junit入门
    lombok
    java 运行指定类的main函数
    席位分配问题——惯例Q值法和d'hondt法的MATLAB程序
    5.2 calendar--通用日期的相关函数(3)
    [笔记]软件体系结构(1)--模式初印象
    hdu 1003
    linux虚拟机上挂载U盘
    Android中Java与web通信
  • 原文地址:https://www.cnblogs.com/whaozl/p/4536458.html
Copyright © 2011-2022 走看看