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

  • Home
  • SEARCH
  • 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 8381381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:41:09+00:00 2026-06-09T16:41:09+00:00

Please could someone explain why the following doesnt work. This happens on the same

  • 0

Please could someone explain why the following doesnt work. This happens on the same click event but the CSS function is not straight after so I dont want to use the callback on the animate function if possible.

Note: animation fires but css doesnt.

            container.animate({
                left : (posLeft + slideWidth),
            });


                container.css({
                left : '-'+(itemsLength + startX)+'px',
            }); 
  • 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-09T16:41:10+00:00Added an answer on June 9, 2026 at 4:41 pm

    .animate isn’t synchronous, that is, there’s absolutely no guarantee that .css is called after .animate is (visually) completed. So in your case, after .animate is called, .css is immediately called, but the left position is quickly overriden by .animate that internally calls setInterval.

    According to the docs, the second argument could be an object that defines the option, and one of them is complete

    If supplied, the complete callback function is fired once the
    animation is complete. This can be useful for stringing different
    animations together in sequence. The callback is not sent any
    arguments, but this is set to the DOM element being animated. If
    multiple elements are animated, the callback is executed once per
    matched element, not once for the animation as a whole.

    container.animate({
       left : (posLeft + slideWidth),
    }, {
       complete: function() {
          $(this).css({ // as per doc, this is the DOM element being animated
             left : '-'+(itemsLength + startX)+'px',
          }); 
       })
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could someone please explain me why replacing the following $('.post_title a').hover(function () { $(this).parent().parent().parent().parent().find(.post_footer).toggleClass('footer_border')
Could someone please help explain why I can't get this to work? I properly
Could someone please explain to me why the following doesn't work: mysql_query(DELETE FROM `categories`
Could someone please explain why this is happening; this following is the code I’ve
Could someone please explain why 'this' in the following points to the DOM Object
Could someone please explain the difference between the following two lines of code: 1.
Please could someone explain to me why this regex does not match anything, when
Could someone please explain why this is happening? var y = new int[]{1,2}; Console.WriteLine(y
Could someone please explain this weird phenomenon: http://jsfiddle.net/sPA2V/ For some reason, the box footer
Could someone please explain to me why the following query is invalid? I'm running

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.