0

我想使用 blockUI ( www.malsup.com/jquery/block/ )。有一点js.code:

function blockSite() {
    var loadImSize = 100;
    $.blockUI({
        message: '<img src="preloader_transparent.gif" width="' +
                loadImSize + 'px" height="' + loadImSize + 'px">',
    css: {
        top: ($(window).height() - loadImSize) / 2 + 'px',
        left: ($(window).width() - loadImSize) / 2 + 'px',
        width: loadImSize + 'px',
            height: loadImSize + 'px'
        }
    });
}
function unblockSite() {$.unblockUI();}
blockSite();
alert(3);
unblockSite();

如何使用块图像出现在警报之前并且图像在警报关闭后消失?我需要确定的用法

blockSite();
alert(3);
unblockSite();

代替

$.blockUI{... ,onBlock: function() {...}, ...}

谢谢

4

1 回答 1

2

You have to disable it's animation:

$.blockUI({..., fadeIn: 0});

Edit: jsFiddle

于 2013-06-17T12:14:06.037 回答