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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:17:52+00:00 2026-06-18T12:17:52+00:00

I have a a Membership Counter that needs to update one digit at a

  • 0

I have a a Membership Counter that needs to update one digit at a time. Below is the function

function siteCounterUpdate(newMembership) {
    var oldMembership = $('span#indexSiteLastMembershipCount').text();
    var digit;
    newMembership = padString(newMembership, 9);
    $('ul#indexSiteCounterBottom').empty();
    for(i=0;i<9;i++) {
            if(newMembership.toString()[i] == '_') {digit = '&nbsp;';}else{digit = newMembership.toString()[i];}
      $('ul#indexSiteCounterBottom').append('<li>'+digit+'</li>');
      $('ul#indexSiteCounterBottom li:nth-child(3n)').addClass('extra-margin');
    }
    $('span#indexSiteLastMembershipCount').text(newMembership);
}
  1. it accepts the new membership say – 1010 members
  2. it gets the old membership that is kept in a span – say 1000 members
  3. it pads the string with nbsp if its less the 9 digits (this relates to the counter images size) – not really important for this quetion and working fine..
  4. it then updates the counter and updates the span.

This works but it updates the counter from 1000 to 1010 in one go. I want it to count up one digit at a time. eg: 1001, 1002, 1003 etc…

I believe I need to use setInterval() – maybe 300ms. I just not sure how to fit this into this function so it loops back on itself.

any advice would be great.

thx

  • 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-18T12:17:53+00:00Added an answer on June 18, 2026 at 12:17 pm

    Try that:

    var log = function(text){
      console.log(text);
      setTimeout(log, 300, text);
    };
    log("hey!");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built a custom membership provider that I have used in a previous
I have a custom membership provider that I've specified to be used in my
I have a site using ASP.NET Membership and have a number of roles that
I have a fairly horrible query using 2 IN statements that needs running on
I have a web site that uses Membership and form authentication: ASP.NET Page: <asp:LoginView
I have a simple membership project and teh client wishes that urls be simple
In my web config I have 2 membership providers defined, one for sql, one
plz help with one issue. I have Membership configured with IIS7, tables for it
I have the default membership table that was added automatically, then just used server
I've seen people say that set objects in python have O(1) membership-checking. How are

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.