Chrome / Firefox doesn't display images in objects shown in beforeunload event

前端 未结 2 1817
鱼传尺愫
鱼传尺愫 2020-12-22 12:11

I\'m using jQuery blockUI plugin to show some nifty \"loader\" on each AJAX call and each URL change.

Here is full code responsible for that:

var roo         


        
2条回答
  •  自闭症患者
    2020-12-22 13:01

    I managed to solve this problem, dropping the idea in favor of CSS and classes:

    
    

    Changing blockUI plugin call to:

    $.blockUI.defaults.message = $('#blockui-animated-content');
    $.blockUI.defaults.css.top = '45%';
    
    $(document).ajaxStart($.blockUI).ajaxStop($.unblockUI);
    $(window).on('beforeunload', function(){$.blockUI();});
    

    Now, all works just fine, both in AJAX and URL change. Unfortunately, this doesn't answer the question: "Why Firefox and Chrome doesn't display images from tags in onbeforeunload event?".

提交回复
热议问题