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 8547169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:12:31+00:00 2026-06-11T13:12:31+00:00

I want to know how or what should be done in implementing loading image

  • 0

I want to know how or what should be done in implementing loading image before my dialog pop’s out? Any gif’s will do. what function or line of code should I add in my function?

————my jquery code:————

 $(".red_img").click(function() {

                });

                $("#red_form").dialog({

                        modal:true,
                        buttons: {
                            "Done": function() {


                            },
                            Cancel: function() {
                                $(this).dialog("close");
                            }
                        }
                });
                $("#red_form").show(500);
            });
  • 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-11T13:12:32+00:00Added an answer on June 11, 2026 at 1:12 pm

    You could show your loading image at the beginning of your click event, and then hide the image just before displaying your dialog:

    // Initially, your loading image must be hidden
    $("#your_loading_image").hide();
    
    $(".red_img").click(function() {
        var red_type = $(this).attr("title").trim();
    
        // Display your loading image here -----------------------------
        $("#your_loading_image").show();
    
        $.ajax({
            url: "get_attributes.php",
            type: "post",
            datatype: "json",
            data: {wtype: red_type},
            success: function(data) {
                var toAppend = '';
                if(typeof data === "object"){
                    toAppend += "<tbody>";
                    toAppend += "<tr></td><td class=datalabel>Type:</td><td>"+data['type']+"</td></tr>";
                    toAppend += "<tr><td class=datalabel>Health:</td><td>"+data['health']+"</td></tr>";
                    toAppend += "<tr><td class=datalabel>Attack:</td><td>"+data['attack']+"</td></tr>";
                    toAppend += "<tr><td class=datalabel>Defense:</td><td>"+data['defense']+"</td></tr>";
                    toAppend += "<tr><td class=datalabel>Speed:</td><td>"+data['speed']+"</td></tr>";
                    toAppend += "<tr><td class=datalabel>Evade:</td><td>"+data['evade']+"</td></tr>";
                    toAppend += "<tr><td class=datalabel>Special:</td><td>"+data['special']+"</td></tr>";
                    toAppend += "</tbody>";
                    $("tbody").remove();
                    $("#red_form table").append(toAppend);
                }
            }
        });
    
        $("#red_form #name").val($(this).attr("alt").trim());
    
        // Hide your loading image here --------------------------------
        $("#your_loading_image").hide();
    
        $("#red_form").dialog({
            width:300,
            resizable:false,
            modal:true,
            buttons: {
                "Done": function() {
    
                    if($("#red_form #name").val().trim()==''){
                        alert("Text field cannot be empty.");
                        $("#red_form #name").focus();
                    }
                    else if($("#red_form #name").val().trim()===$("#blue_name").val().trim()){
                        alert("Name cannot be the same by other player.");
                        $("#red_form #name").focus();
                    }
                    else {
                        $("#red_name").val($("#red_form #name").val().trim());
                        $("#red_type").val(red_type);
                        $("#red_form").hide(400);
                        $(this).dialog("close");
                    }
                },
                Cancel: function() {
                    $(this).dialog("close");
                }
            }
        });
        $("#red_form").show(500);
    });
    

    where #your_loading_image is your loading image, like for example:

    <img id="your_loading_image" src="your_loading_image_path.gif"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The thing I want to know here should be really 'basic', but it is
I want to know that how one should proceed in building animated splash screen.
I want to know exact , whether should I used parcelable or serialization technique
I want to know if the system has a attached webcam. How should i
I want to know the version of a mp3 file format. What should I
I want to know if there is any good way of programmatically producing C#
I want to write a .htaccess from which the following action should be done.
I want to know from a technical view if there is any profit of
Before going to install MSSQLSERVER, I want to know whether MSSQLSERVER is already installed
i want know how i can manage multiple twitter account on iOS in my

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.