I am having trouble running jQuery blockUI. I am using this code:
$.blockUI({
message : null,
overlayCSS : {
backgroundColor : '#000000;',
opacity : .4
}
});
If I just call above and then call the sleep function below, I get the following behavior: Nothing happens for 5 seconds The unit blinks
var start = new Date().getTime();
for (var i = 0; i < 1e7; i++) {
if ((new Date().getTime() - start) > 5000) {
break;
}
}
If I run this code:
alert("foo");
$.blockUI({
message : null,
overlayCSS : {
backgroundColor : '#000000;',
opacity : .4
}
});
var start = new Date().getTime();
for (var i = 0; i < 1e7; i++) {
if ((new Date().getTime() - start) > 5000) {
break;
}
}
alert("bar");
I get the following behavior:
A warning and a block will appear (I can wait indefinitely before clearing the warning)
When I remove the warning button, nothing happens for 5 seconds
The warning switches to the message "bar"
The warning and the blocker are cleared when the warning is disabled
source
share