Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8439769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:05:34+00:00 2026-06-10T08:05:34+00:00

I did some research, but I couldn’t reach the answer for my problem. I

  • 0

I did some research, but I couldn’t reach the answer for my problem. I want to have a loading image when I am clicking on a tab from my menu item. The following piece of code works great for specific events such as click() etc. (I have tried some other several examples), but it doesn’t when my gridview is loading. I was wondering, is there any kind of event in jquery (I haven’t find any) that reffers to when a control/entity STARTS to perform loading? I mean load(),onload(),ready() – all refer to the moment when the loading has finished.

Here is my code. Any help/suggestion is kindly appreciated:

<script type="text/javascript">
    $(document).ready(function () {
        $("#spinner").bind("ajaxSend", function () {
            $(this).show();
        }).bind("ajaxError", function () {
            $(this).hide();
        });
    });
</script>

Also,

<script type="text/javascript">
    $(document).ready(function () {
        $('#btnSave,#btnOne,#btnTwo,#btnThree,#btnFour,#btnUndo').click(function () {
            //$("#spinner").append('<img id="img-spinner" src="Images/ajax-loader-test.gif" alt="Loading.." style="position: absolute; z-index: 200; left:50%; top:50%; " />');
            $('#spinner').show().fadeIn(20);
        });
    });
</script>

And the Asp code:

<div id="spinner" class="spinner" style="display: none; width: 100%; height: 150%; position: absolute; z-index: 100; background-color: Gray; left: 0; top: 0; bottom: 0; right: 0">
     <img id="img-spinner" src="Images/ajax-loader-test.gif" alt="Loading.."         style="position: absolute; z-index: 200; left: 50%; top: 50%;" />
</div>

Thank you, in advance, for your help.

EDIT: I have tried changing my function into:

    $(document).ready(function () {
    $("#spinner").css.apply('display','none');
    });

and in my asp code I removed the display:none property, but it’s still not working and I haven’t got any clue what I am doing wrong.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T08:05:36+00:00Added an answer on June 10, 2026 at 8:05 am

    I would add this code to your startup function:

    $('body').ajaxStart(function() {
      $('#spinner').show();
    });
    
    $('body').ajaxComplete(function() {
      $('#spinner').hide();
    });
    

    That will show the div when the ajax call starts, and hide it when it completes.

    To make the spinner show as the page loads initially, add this line to the document.ready:

    $("#spinner").hide();
    

    and take the “display: none;” off of the spinner div.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I did some research but couldn't find the answer I was looking for so
I did some research on Google but I couldn't find any HTML5 browser for
I did some research but all I could find was syncing data core with
I did some research but cannot find a definite approval or disapproval. What I
Did some googling and couldn't find a clear answer on this. My assumption is
This is a homework problem that I have. I have been doing some research
I did a lot of research on this subject but couldn't find any end
I did some research on the topic but could not find anything similar to
I did a series of research on this topic, but unfortunately I couldn't find
I did some research and found that the only way to vertically center a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.