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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:22:45+00:00 2026-05-23T20:22:45+00:00

Please, can you checkout http://svpply.com , move the pointer on a image and click

  • 0

Please, can you checkout http://svpply.com , move the pointer on a image and click + when it appears. If you’re careful you can see a very nice loader when you’ve clicked +, and after some moments appear a v.

How can I implement something like that? In that process there’s not “white view” between the three step (+, loading, v). Ideas?

Actually I’ve this code:

$(".add_button").live("click", function() {
    var element = $(this),
        data = "id=" + this.id;

    element.css("background-image", "url(/media/images/loader.gif)")

    $.ajax({
        type: "POST",
        url: "/product/add/",
        data: data,
        success: function(result) {
            element.css("background-image", "")
            element.removeClass("add_button").addClass("del_button");
        }
    });

    return false;
});

But between the three steps I see an ugly “white image”. Why?

UPDATE

Now I’ve:

$(".add_button").live("click", function() {
    var element = $(this),
        data = "id=" + this.id;

    element.removeClass("add_button").addClass("spinner");

    $.ajax({
        type: "POST",
        url: "/product/add/",
        data: data,
        success: function(result) {
            element.removeClass("spinner").addClass("del_button");
        }
    });

    return false;
});

But still the same problem. Unfortunately I cannot find the interested source in the svpply source code.

UPDATE

<div class="add_button" id="id"></div>
  • 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-05-23T20:22:47+00:00Added an answer on May 23, 2026 at 8:22 pm

    Oh yessss, this is a good question 🙂

    So basically it has to do with AJAX and the different kind of settings! You need to use ajax:beforeSend and ajax:success (or ajax:complete if you’re doing more loading after success). Which means you can do something like (assuming your button is wrapped in a form)

    $(".add_button").parent("form").bind("ajax:beforeSend",function(e,data,status,xhr) {
            $("#someDiv").append("<img id='loading' src='url/to/loading/gif'></img>");
            // and any other things you want to do like removing the button or disabling it
    });
    

    That function will execute BEFORE the client (your computer) sends the request to the server. You can also add a lot of stuff in there and modify the option to request you are actually sending to the server!

    Then you can have

    $(".add_button").parent("form").bind("ajax:success",function(data,textStatus,jqXHR) {
            $("#loading").remove();
            // and any other things like adding your del button
    });
    

    Which is called after the server sends back the object to the client for you to play with, in which case you can remove your #loading img and do other cool things!

    I really suggest you reading on the link and completely understand how AJAX works, and how the client interacts with the server. Once you understand that, you can do a lot of cool things like this! Good luck.

    EDIT

    You can check out a working example of this (which doesn’t use a loading gif but instead disables input) at this prototype I’m building. Click on the animating circle and try to submit a comment. You’ll notice that after you hit enter, the comment input box is disabled until the comment is rendered back on your screen!

    In your case, your code would look like

    $.ajax({
        type: "POST",
        url: "/product/add/",
        data: data,
        beforeSend: function(msg) {
            // do the stuff you want to do
        },
        success: function(result) {
            element.removeClass("spinner").addClass("del_button");
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please check out this jsfiddle http://jsfiddle.net/rr4GH/1/ As you can see its a round edge
Please check out the jsfiddle link below: http://jsfiddle.net/H49EC/1/ As you can see it is
Please check out the jsFiddle link below: http://jsfiddle.net/pnpHS/4/ As you can see its a
Please check out this link: http://davidwalsh.name/dw-content/textboxlist.php As you can see its a textbox list
Please check out this link quickly: http://jsfiddle.net/8grSk/ As you can see the text as
Could some on please check out this URL with Mozilla - http://smartplast.com/soon/ . As
I want ot get response for the google checkout .I have used http://code.google.com/apis/checkout/samples/Google_Checkout_Sample_Code_PHP_CheckoutShoppingCartDemo.html#googleCheckoutFunctionDisplayDiagnoseResponse The
I am using a third-party shopping cart from http://simplecartjs.com/ . For a normal checkout
Please check out this issue: http://code.google.com/p/android/issues/detail?id=20791 The project (https://github.com/kaciula/BugRetain) uses a CursorLoader to take
Please can you suggest me an example in classic asp and ajax to make

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.