• 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);
                });
            }
  • 相关阅读:
    Educational Codeforces Round 21
    Educational Codeforces Round 22
    Educational Codeforces Round 43
    Educational Codeforces Round 20
    Educational Codeforces Round 19
    Educational Codeforces Round 18
    Hello World!
    训练记录
    2020 Multi-University Training Contest 6
    2020 Multi-University Training Contest 5
  • 原文地址:https://www.cnblogs.com/whaozl/p/4536458.html
Copyright © 2020-2023  润新知