动画位于屏幕中央

var topOffset = ($(window).height() - 175) / 2,
var leftOffset = ($(window).width() - $('loading').width()) / 2 - 60;

                $('.loading').css({
                    top: topOffset,
                    left: leftOffset,
                    right: 'auto',
                    bottom: 'auto'
                });

原文地址:https://www.cnblogs.com/zhouyx/p/4736979.html