The CSS for the ajax call functions correctly on desktop devices but is not displaying properly on mobile devices

My ajax call is facing an issue where the CSS classes for a loader and overlay are only being applied in desktop view, not mobile view. I am unsure of what mistake I may be making. Can someone help me resolve this problem?

Here is the ajax call:

function filterAjax(s_url){         
        $.ajax({
            type: "GET",
            data : {is_ajax:1},
            url: s_url,
            beforeSend: function() {
                initLoader();
            },
            success: function(data) {
                killLoader();               
                updatePage(data);
                filter();
                $(".offcanvas-siderbars").removeClass("column-left-active");
            },
            error: function(jqXHR, textStatus, errorThrown) {
                //console.log(errorThrown);
            }
        });     
    }

The functions in question are:

function initLoader() {
        $('.mkmage-overlay').fadeIn(200, function(){
            $('.mkmage-loader').show();
        });
    }

    function killLoader() {
        $('.mkmage-loader').hide();
        $('.mkmage-overlay').fadeOut(200);
    }

Here are the CSS classes used:

.mkmage-overlay{
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    opacity: 0.5;
    background-color: #363636;
    z-index: 10000;
    top: 0;
    left: 0;
}
.mkmage-loader{
    display: none;
    width: 60px;
    height: 60px;
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 1000000;
    transform: translate3d(-50%,-50%,0)
}

Answer №1

According to the poster's comment, the issue arose due to the placement of .offcanvas-siderbars within an HTML element that is only visible in desktop mode, causing it to be hidden in mobile mode.

Glad I could assist!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Saving and retrieving user input as a variable using Javascript and HTML local storage

This is the foundation of my HTML page. When the "remember text" paragraph is clicked, the data in the input text box is saved to local storage as a string. Clicking the "recall text" paragraph loads the stored data into the "recalled text" paragraph. I am ...

Unable to figure out a method to properly synchronize a vue.js asynchronous function

I am facing an issue with my code where everything works fine if I uncomment the "return" statement in fetchData. How can I make sure that I wait for the completion of this.fetchData before populating the items array? I have tried using promises, async/awa ...

Encountered an error while trying to load a resource: the server returned a 404 (Not Found) status code while attempting to edit a form using

I am facing an issue with navigating to the correct path after editing a form in React. Following the update, the web page refreshes and unexpectedly logs me out of the site even though there are no errors detected during the process. The console displays ...

Increase and decrease the size of a table row in real-time

I am attempting to create a bootstrap table in which clicking a button in the first column will expand the specific row to show more details. I am aiming for a result similar to what can be found at this link, but without using the DataTables framework. ...

The CSS stylesheets are not compatible with IE7 and IE8

I am encountering an issue with my local site where the CSS links are not being included in the page, particularly in IE7 and IE8. The technologies I am using include WordPress 3.6, Bootstrap 3, Modernizr, and jQuery. Source Code <!DOCTYPE HTML PUBLI ...

Configuring the Port for NodeJS Express App on Heroku

Currently, I am in the process of hosting my website on Heroku and configuring everything to ensure my app is up and running smoothly. However, each time I attempt to submit the form, undefined errors occur. For more details on the Undefined Errors and Co ...

Retrieving information from a Vue component using AJAX

One of the components in my Vue project is named "testrow". It contains a form with two selections: "description" and "parameter". I need to make sure that the "parameter" changes based on the selected 'description' value stored in my database. T ...

JavaScript - Loading image from local file on Linux machine

I have a server running and serving an HTML page, but I am trying to display an image from a local drive on a Linux machine. I've tried using file://.., but it doesn't seem to be working for me on Ubuntu 18.04. There are no errors, the img tag ju ...

Discovering the channel editor on Discord using the channelUpdate event

While working on the creation of the event updateChannel, I noticed that in the Discord.JS Docs, there isn't clear information on how to identify who edited a channel. Is it even possible? Below is the current code snippet that I have: Using Discord. ...

Is there a way to extract and store an image from a webpage using selenium, beautifulsoup, and Python 3?

Currently, my main goal is to extract and save a single image from a website post logging in. After examining the image, I discovered that it has a full xpath of /html/body/form/main/div/section/div[1]/div/div[2]/div/img. My plan is to utilize beautiful so ...

Creating a JSON file using an object to send requests in Angular

In my Angular 7 project, I am trying to send a multipart request to the server that includes a file (document_example.pdf) and a json file containing a data object (data_object_example.json). The content of data_object_example.json is as follows: { " ...

A guide on extracting JSON data from a script tag using Cheerio

I am in the process of extracting metadata from various websites. While utilizing Cheerio to retrieve elements like $('meta[property="article:published_time"]').attr('content') works smoothly for most sites, there are some whe ...

Struggling to process AJAX request

Trying to manually create an AJAX request. I have the following code on the client side: function saveBatterySpecs(id) { var url = '@Url.Action("SaveBatterySpecs", "Catalog")'; $.ajax({ type: "post", ...

Kendo React UI DataTable Filter providing a consistent experience similar to the JQuery Kendo UI

When using Kendo React, the grid's filter appears as a line below the header by default, as shown in the following image: https://i.sstatic.net/1CgIi.png However, in the JQuery version, the filter is presented as a button that triggers a modal windo ...

Is there a way to create an input field that accepts only numbers and behaves like a password field simultaneously?

I am attempting to develop an input field for entering a PIN. I would like the PIN to be masked on mobile devices, similar to how passwords are obscured in password input fields. I came across a suggestion on stackoverflow regarding this, but unfortunately ...

Troubleshooting the Google OAuth 2.0 SAMEORIGIN Issue

Trying to bypass the SAMEORIGIN error while using Google's JavaScript API is a timeless challenge. Here is an example of what I have tried: let clientId = 'CLIENT_ID'; let apiKey = 'API_KEY'; let scopes = 'https://www.google ...

Performing a Destroy Action with AJAX in Rails

Having an issue with AJAX on a friendships list, specifically with the "Request Friendship" button not turning into a "Cancel Request" button when clicked. The first click works fine, but the second click does not change the button back. The error message ...

Using jQuery to append text after multiple element values

I currently have price span tags displayed on my website: <div> <span class="priceTitle">10.00</span> </div> <div> <span class="priceTitle">15.00</span> </div> <div> <span class="priceTitle">20.0 ...

The ngIf statement in the template isn't functioning properly after a refresh; instead, it is causing a redirection to the homepage

I've been developing with Angular 7, trying to display a <div> ... </div> based on multiple values that I declared as : Boolean = false; in the .ts file. These values are updated in ngOnInit, but for some reason, the page keeps redirecting ...

Generate a CSV file using Javascript

I am working with an HTML table (table id='testTable') and a button in the HTML code: <button id="btnExport" onclick="javascript:xport.toCSV('testTable');">CSV</button> There is also JavaScript code involved: toCSV: func ...