<section id="ajax-loading">
    <div id="ajax-loading-content"></div>
</section>

<script>
    $(document).ajaxStart(function() {
        $('#ajax-loading').addClass('ajax-loading');
        $('#ajax-loading-content').addClass('ajax-loading-content');
    });

    $(document).ajaxStop(function() {
        $('#ajax-loading').removeClass('ajax-loading');
        $('#ajax-loading-content').removeClass('ajax-loading-content');
    });
</script>
