blockui icon indicating copy to clipboard operation
blockui copied to clipboard

Add a fade in delay

Open rottmann opened this issue 12 years ago • 2 comments

For an application, that communicate with a server, i use blockUI when a request start and unblockUI when the request finish.

Many times the response arrive quick (less then 200 ms), in that case the blockUI flash a short time, that looks not so good (increasing fadeIn time is not the solution).

A delay for displaying could defuse the problem, e. g. i modify the code a little bit: (line 418)

            if ((msie || opts.forceIframe) && opts.showOverlay)
                lyr1.show(); // opacity is zero
            if (opts.fadeIn) {
                var cb = opts.onBlock ? opts.onBlock : noOp;
                var cb1 = (opts.showOverlay && !msg) ? cb : noOp;
                var cb2 = msg ? cb : noOp;
// MOD: start
this.timer = setTimeout(function() {
                    if (opts.showOverlay)
                        lyr2._fadeIn(opts.fadeIn, cb1);
                    if (msg)
                        lyr3._fadeIn(opts.fadeIn, cb2);
}, opts.fadeInDelay);
// MOD: end
            }

and on unblockUI clear the timer.

rottmann avatar Aug 24 '13 11:08 rottmann

Or support specifying jQuery's easing functions.

VsevolodGolovanov avatar Jan 22 '15 19:01 VsevolodGolovanov

if anyone needs this functionality, I added it to my copy of BlockUI in one of my projects. The source is here.

pablocar80 avatar Jan 15 '20 15:01 pablocar80