$(document).ajaxStart(function() { $.LoadingOverlay("show", { image: "", fontawesome: "fa fa-cog fa-spin" }); }); $(document).ajaxStop(function() { $.LoadingOverlay("hide"); });
Với config ở trên thì khi action ajax được chạy thì nó tạo ra 1 hiệu ứng mờ mờ toàn page.
giờ mình muốn tắt effect loadingOverlay trên 1 vài ajax và mình không muốn thì làm sao?
https://stackoverflow.com/questions/12604722/disable-ajaxstart-and-ajaxstop-for-a-specific-request

I figured it out..
There is an attribute in the options object .ajax()
takes called global
.
If set to false, it will not trigger the ajaxStart
event for the call.
$.ajax({ timeout: 35000, url: longPollUrl, success: function(data){ if(data.queCount) $('#numQueCount').html(data.queCount); if(data.queAccept) $('#numQueAccept').html(data.queAccept); }, global: false, // this makes sure ajaxStart is not triggered dataType: 'json', complete: longpoll });