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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:27:06+00:00 2026-06-12T13:27:06+00:00

Trying to do a bit of jquery for a landing page I’m putting up.

  • 0

Trying to do a bit of jquery for a landing page I’m putting up. I’m absolutely horrible at JS so bear with me.

Here’s the page where I’m developing it:

http://kickstartyourbiz.info/

For the rotating numbers under the placeholder pic, I’m using the following code:

<script>

setInterval(function() {
  var min = 1000;
  var max = 100000;
  var number = 1 + Math.floor(Math.random() * (max - min + 1)) + min;
  $('#random_number').fadeIn(500).text(number).delay(4000).fadeOut(450);
  var newnumber = Math.round(number / .6);
  $('#wtf').fadeIn(500).text(newnumber).delay(4000).fadeOut(450);
},
5000);

</script>

<div id="random_number"></div>

<div id="wtf"></div>

Few problems with this:

1) the numbers don’t load until five seconds, which I’m assuming is due to the interval. But how do I get the numbers to start showing/rotating as soon as the page loads?

2) when the numbers fade out, the lower “logo” section is brought up, then back down. I’m guessing this is because the <div> disappears when the fade out occurs, then comes back when it fades in again. What can I do to prevent this?

Lastly, I would also like to add a dollar sign to the beginning of the numbers, and, if it’s simple enough, put commas in every three numbers. So it would look something like this:

$93,029 – $163,029

Thanks for any help, really appreciate it!

EDIT:

Okay, think I might know what the issue is, to some extent…

So when I have this function:

function() {
  var min = 1000;
  var max = 100000;
  var firstnumber = 1 + Math.floor(Math.random() * (max - min + 1)) + min;
  $('#random_number').text(firstnumber);
  var newnumber = Math.floor(firstnumber / .6);
  $('#wtf').text(newnumber);
}

and then try and call it with , nothing shows up on the page. But then when I use this code:

setInterval( function() {
  var min = 1000;
  var max = 100000;
  var firstnumber = 1 + Math.floor(Math.random() * (max - min + 1)) + min;
  $('#random_number').text(firstnumber);
  var newnumber = Math.floor(firstnumber / .6);
  $('#wtf').text(newnumber);
},
5000);

It DOES show up on the page, but only after 5 seconds.

So I’m wondering why it won’t show up on the page without setInterval?

  • 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-12T13:27:07+00:00Added an answer on June 12, 2026 at 1:27 pm
    1. The numbers don’t load until five seconds

      The reason is that, you execute the function() {var min ... (450);} only after 5000 milliseconds.

      Replace:

      setInterval(function() {
          var min = 1000;
          var max = 100000;
          var number = 1 + Math.floor(Math.random() * (max - min + 1)) + min;
          $('#random_number').fadeIn(500).text(number).delay(4000).fadeOut(450);
          var newnumber = Math.round(number / .6);
          $('#wtf').fadeIn(500).text(newnumber).delay(4000).fadeOut(450);
      },
      5000);
      

      With:

      $(document).ready(function () {
        var min = 1000;
        var max = 100000;
        var number = 1 + Math.floor(Math.random() * (max - min + 1)) + min;
        $('#random_number').fadeIn(500).text(number).delay(4000).fadeOut(450);
        var newnumber = Math.round(number / .6);
        $('#wtf').fadeIn(500).text(newnumber).delay(4000).fadeOut(450);
      
        setInterval(function() {
          var min = 1000;
          var max = 100000;
          var number = 1 + Math.floor(Math.random() * (max - min + 1)) + min;
          $('#random_number').fadeIn(500).text(number).delay(4000).fadeOut(450);
          var newnumber = Math.round(number / .6);
          $('#wtf').fadeIn(500).text(newnumber).delay(4000).fadeOut(450);
        },
        5000);
      }
      
    2. What can I do to prevent this?

      Consider using opacity instead of fadeOut as it takes away content from the DOM, which gives you the jump.

    3. I would also like to add a dollar sign to the beginning of the numbers

      Consider using jQuery Number Format, a jQuery plugin, which does the same thing which you expect.

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

Sidebar

Related Questions

Bit of a jquery Newbie here, so go easy. Basically I'm trying to plug
I'm a bit confused over jQuery terminology for what I'm trying to accomplish. Essentially
So I have been dabbling around in jQuery a bit this week. Trying to
I am trying to improve my jQuery skill and I have this bit of
I am trying to call to the bit.ly URL shortening service using jQuery with
I'm trying to write a bit of jquery which finds all h2 tags inside
I'm developing a WordPress 3.0 theme, my first theme with a bit of jQuery
I am trying to execute a simple bit of jQuery or JavaScript once logged
I'm trying to add a bit of jQuery code to all elements that have
I'm a noob at json (know a bit of jquery)....and trying to get a

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.