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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:42:34+00:00 2026-05-14T02:42:34+00:00

I have this function, that adds 31px to my style bottom on ul. It

  • 0

I have this function, that adds 31px to my style bottom on ul.
It works fine, but if I click fast, it no longer adds 31px, but some weird number like 17.423px. I guess it’s because the animation isn’t done, and thereby by clicking fast it adds 31px to the current px amount. My thought is that I need to insert a stop(). But where?

$(function () {
        $('.topTenTwocolumns .topTenTwocolumnsWrap .down').click(function () {
            if ($("ul").css("bottom") !== '2728px') {
                $(this).parents('.topTenTwocolumnsWrap').children('ul').stop().animate({
                    bottom: '+=31'
                }, 200);
            }
        });
    });
  • 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-14T02:42:34+00:00Added an answer on May 14, 2026 at 2:42 am

    The animations are queued, but it might be that the values to animate are calculated before the animation is queued, and as you are using a relative value it would calculate the animation from it current position.

    You already have a stop call in the code. I don’t know if you added that afterwards, otherwise that could also explain the values. If you stop the animation halfways, the bottom value will naturally be changed halfways.

    You could keep the current target value in a variable so that you can specify an absolute value for the animation:

    $(function () {
    
       var current = 0;
    
       $('.topTenTwocolumns .topTenTwocolumnsWrap .down').click(function () {
          if (current < 2728) {
             current += 31;
             $(this).parents('.topTenTwocolumnsWrap').children('ul').stop().animate({
                bottom: current + 'px'
             }, 200);
          }
       });
    });
    

    This way you can keep the stop call so that the new animation replaces the previous instead of being queued.

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

Sidebar

Related Questions

I have this function: /** * Helper function that adds the values of b
Ok so I have this function that when a contact is clicked it adds
I have this function which gets some variables and adds shadow to them, and
I have this function that prints the name of all the files in a
I have this function that converts all special chars to uppercase: function uc_latin1($str) {
So I have this function that forks N number of child processes. However it
I have this function called ProperCase that takes a string, then converts the first
I have this function in my Javascript Code that updates html fields with their
I have this function on my controller (Im using CodeIgniter) that reads the database,
I have this function to edit all fields that come from the form and

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.