• fadedguy7

    (@fadedguy7)


    Hi guys, I’ve got quite weird problem. I built product filtering options, sometimes the server is slower so I wanted to add a loading spinner while you wait for the results. I only managed 50% because it works on desktop browsers and, unfortunately, nothing shows on mobile. Anyone have an idea why this can happen?

    
    $('.auto_submit_item').change(function(){
    	var filter = $('#filter');
            jQuery('#m-spinner').addClass('is-active');
    	$.ajax({
    		url:filter.attr('action'),
    		data:filter.serialize(), // form data
    		type:filter.attr('method'), // POST
    		beforeSend:function(xhr){
                        // jQuery('#m-spinner').addClass('is-active'); //option2
    		},
    		success:function(data){
                        // jQuery('#m-spinner').removeClass('is-active'); //option2
    		    $('#response').html(data);
    	        }
    	}, function( response ) {
                    jQuery('#m-spinner').removeClass("is-active"); 
            });
    	return false;
    });
    

    I tried both options, one which is visible right now, and second one which is in comments. Both options work on desktop but dont work on mobile android and/or iOS.
    Any idea how to fix it?

    • This topic was modified 3 years ago by fadedguy7.
    • This topic was modified 3 years ago by fadedguy7.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Vijay Hardaha

    (@vijayhardaha)

    I am guessing, you didn’t turn off WP Rocket while doing your development and on desktop, you might be checking things when logged in where cache didn’t apply and on mobile, you have cache version as you were not logged in.

Viewing 1 replies (of 1 total)
  • The topic ‘Ajax filtering option loading spinner – problem on mobile’ is closed to new replies.