How can I prevent ajaxStart from running?

0

I have a code that shows a load symbol when there is an ajax query, everything works well the question is that I have done a dynamic select2 that loads the data with ajax and I find it annoying that when I write in the input the symbol appears in the middle of the screen.

Is there any way to prevent this?

$(function () {
    const screen = $('#overlay');
    loadingScreen(screen);
    });
    function loadingScreen(screen) {
        $(document).ajaxStart(function () {
            screen.fadeIn();
        })
        .ajaxStop(function () {
            screen.fadeOut();
        })
    }

That's the code I use for when AJAX is activated, show my symbol.

    
asked by denifer santiago fernandez 20.12.2018 в 04:56
source

0 answers