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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:51:27+00:00 2026-06-07T03:51:27+00:00

I’ve been working on this issue for the last few hours and it has

  • 0

I’ve been working on this issue for the last few hours and it has confounded my tiny brain.

What is happening is that an jQuery animate animation seems to stop during the animation, thus stopping the callback from happening.

The problem is that this happens so intermittently and randomly that i’m not able to locate the issue in my code. It appears to happen roughly 1 in 7 times. Yet it can happen the first time or after 10 times.

Im not really able to put together a jsfiddle in this case because it is linked so closely to other sections of the site. Instead i would like to leave a link here and point to the relevant section. Here is a link to the site in question. The code shown below starts on line 219. If you take a look at the firebug console you can see the logs i have made as the code runs through. You can also see that the css property left has not animated all the way to completion when the issue happens.

Below is an image showing the issue. Take note that the css left property is not at 664px (where it would be if the issue didnt happen).

enter image description here

Below is the relevant code.

    $(".close").live("click", function() {

        console.log("--------------------");
        console.log("Close button has been clicked");

        var toMove = $(this).parent().attr("class").replace("infoBox ", "");

        $(this)
            .parent()
            .fadeOut("fast");

        console.log("Setting #" + toMove + " back to default position");

        $("#" + toMove)
            .removeClass("active")
            .addClass("ready")
            .delay(100)
            .animate({
                left: $("#" + toMove).attr("data-left").replace("px", "")
            }, 200, function() {
                console.log("Animate has finished. Now checking all images are in the right place");
                resetAll();
                $(".close").remove();
        });
    });

Anything wrong with my question? let me know, im more than happy to amend + edit so it meets stackoverflow’s strict standards!

Related

Bug with .animate()'s callback?

  • 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-07T03:51:28+00:00Added an answer on June 7, 2026 at 3:51 am

    Try to add an intermediate state to your icon. As soon as you click on the close button, the class goes from “active” to “ready”. Add “moving” for instance and don’t let any other function be called while its state is “moving”. When it has returned to its initial position, you can set the class to “ready” again.

    $("#" + toMove)
            .removeClass("active")
            .addClass("moving")
            .delay(100)
            .animate({
                left: $("#" + toMove).attr("data-left").replace("px", "")
            }, 200, function() {
                console.log("Animate has finished. Now checking all images are in the right place");
                resetAll();
                $(".close").remove();
        })
            .removeClass("moving")
            .addClass("ready");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a jquery bug and I've been looking for hours now, I can't
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has

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.