简体   繁体   中英

Unblock-UI Not working In Mozilla and IE-11

I have added block UI in My project here is the code which I am using

$(document).ready(function () {
  $.ajax({
    type: "POST",
    data: "",
    url: "<?php echo SITE_SCRIPT_PATH;?>get_dashboard_tiles",
    beforeSend: function () {
        $(".right_con").css("min-height", "300px").block();
        $(".blockOverlay").css("background-color", "");
        $(".right_con").unblock();
    },
    complete: function () {
        $(".right_con").unblock();

    },
    success: function (r) {
        $("#box_set").append(r);
        render_dashboard_tiles();
        lazyLoadTiles();
    }
  });

In all browser excepting IE-11 and Mozilla the unblock-UI is not working. even it is not coming in completed block, so any one can suggest me where I am wrong

This should be done this way:

$.ajax({
   type: "POST",
   data: "",
   url: "<?php echo SITE_SCRIPT_PATH;?>get_dashboard_tiles",
   beforeSend: function () {
      $(".right_con").css("min-height", "300px");
      $(".blockOverlay").css("background-color", "");
      $.blockUI();  //<---add this
  },
  complete: function () {
      //$(".right_con").unblock();
      $.unblockUI(); // <----and this
  },
  success: function (r) {
      $("#box_set").append(r);
      render_dashboard_tiles();
      lazyLoadTiles();
  }
});

Initialize it in beforeSent func

$.blockUI();

and unblock it in complete function with:

$.unblockUI();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM