curious1
curious1

Reputation: 14717

BlockUI plugin: how to call it manually?

I am using JQuery BlockUI plugin for my project. Here is the link of this tool:

http://malsup.com/jquery/block/

I am hoping to call it manually before heavy (non-Ajax) computation and end it after it. I tried many times, but not able to get it work. I tested the following:

$.blockUI({ overlayCSS: { backgroundColor: '#00f' } }); 

before doing the heavy computation. But no blocking.

Update 1

I already have

$(document).ajaxStart($.blockUI(bui)).ajaxStop($.unblockUI);

in my program and it is work perfectly.

Now I want to use $.blockUI for non-ajax call only in this place, but it is not working.

Update 2

Here is code structure. I tested BlockUI in two places separately, but not working.

$.blockUI(); //place 1

$.ajax({
      url: '/js/a_big_map_file.js',
      dataType: "script",
      async: false,
      success: function(mapjs) {

      $.blockUI(); //place 2
      ...
      //heavy computation is here
      ...
});

Upvotes: 0

Views: 870

Answers (0)

Related Questions