Background issue when opening menu in laravel

I am having background issue when opening menu in Laravel. Exactly what I want to do is actually the menu in the example below.

When opening the menu with Ajax, the background is also opened. I can’t turn off the background while the menu is closing 🙁

thank you all

sample : https://www.envelopes.com/

        $('.category-nav-element').each(function (i, el) {
        $(el).on('mouseover', function (e) {
            e.preventDefault();
            if (!$(el).find('.sub-cat-menu').hasClass('menuShow')) {
                $.ajax({
                    url: '{{ route('category.elements') }}',
                    method: "POST",
                    data: {
                        "_token": "{{ csrf_token() }}",
                        "id": $(el).data('id')
                    },
                    success: function (html_content) {
                        $(el).find('.sub-cat-menu').addClass('menuShow').html();
                        $(el).find('.sub-cat-menu').addClass('menuShow').html(html_content);
                        $(".menu_overlay").css("display", 'block');
                    }
                });
            }
        });
    });