Jquery - How to disable the entire page

后端 未结 8 2146
伪装坚强ぢ
伪装坚强ぢ 2020-12-05 19:31

I have this ajax event

function save_response_with_ajax(t){
  var form = $(\'#edit_\'+t);
  var div = $(\'#loading_\'+t);
  $.ajax({
    url: form.attr(\"act         


        
相关标签:
8条回答
  • 2020-12-05 20:19

    Use jQuery ajaxStart() to append a Div to your document. Set it to the size of your document with some form of semi-transparent document. Then remove it on ajaxStop().

    0 讨论(0)
  • 2020-12-05 20:21

    Try appending an overlay during the "beforeSend" function:

    $("body").prepend("<div class=\"overlay\"></div>");
    
    $(".overlay").css({
        "position": "absolute", 
        "width": $(document).width(), 
        "height": $(document).height(),
        "z-index": 99999, 
    }).fadeTo(0, 0.8);
    
    0 讨论(0)
提交回复
热议问题