首页 > 其他 > 详细

Boostrap 模态框 水平垂直居中问题

时间:2015-05-28 17:44:24      阅读:896      评论:0      收藏:0      [点我收藏+]
        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);
            });
        }

Boostrap 模态框 水平垂直居中问题

原文:http://www.cnblogs.com/whaozl/p/4536458.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!