Home >
Programming, Servers & Scripts >
Count UP Timer? (12)
04-02-2012 08:27 PM
#1
profitable ()
Count UP Timer?
I would like to have a number count up on my landing page.
Example:
1137 people have signed up for this offer
then
1149 people have signed up for this offer
then
1201 people have signed up for this offer
The number would steadily increase every second or two to show "new user activity".
does anyone have an idea or a script handy that can do something like that?
04-02-2012 08:54 PM
#2
dubbsy (Member)
Edit: Added Code.
Add this to top of page in between head tags:
Code:
<script language="JavaScript" type="text/javascript">
var num=19005;
var t;
function dis_num()
{
document.getElementById("dispnum").innerHTML=num;
num=num+1;
if(num<=20000){
t=setTimeout ("dis_num()", 3000);
}
}
</script>
Then wherever you want to display the counter add this:
Code:
<span id="dispnum"></span>
Leave the space in between the <span></span> blank.
var num = put whatever # you want to start with
num+ = how ever much you want it to count up by
if(num<=20000){
t=setTimeout ("dis_num()", 3000);
}
That part ^^ (I think) is the parameter that says if the var num is less than or equal to that # then count up num+ # you decide, every x seconds, in this case, 3000 is milliseconds , or 3 seconds.
Hit me up if it's not working and I'll be happy to help!
04-02-2012 09:42 PM
#3
profitable ()
hmm, not working for me yet. did it exactly as you posted. can you check it real quick? thanks.
04-02-2012 10:12 PM
#4
dubbsy (Member)
oh shit my bad... forgot to add this:
Code:
<body onload="dis_num()">
use that instead of just <body>
04-02-2012 11:17 PM
#5
profitable ()
There it goes. works great, thanks man.
04-02-2012 11:43 PM
#6
dubbsy (Member)
Anytime!
01-07-2015 06:42 PM
#7
zeno (Administrator)
Does it load locally?
02-17-2016 06:16 PM
#8
ibravo (Member)
thank you for this tuto
one question, how can i change the style of the timer, size, color....?
02-17-2016 06:35 PM
#9
bobliu (Member)

Originally Posted by
ibravo
thank you for this tuto

one question, how can i change the style of the timer, size, color....?
CSS my friend. Just before </head> add:
Code:
<style>
span#dispnum{
font-size:24px;
color:red;
}
</style>
02-17-2016 06:59 PM
#10
cflagle (Member)
Anyone know if this is impactful?
02-17-2016 07:09 PM
#11
bobliu (Member)

Originally Posted by
cflagle
Anyone know if this is impactful?
As with anything only testing will tell. Will work for great for some campaigns, maybe not so much for others. It adds a sense of urgency, 'oh look 27 people just signed up, I better get in before the next person'
02-18-2016 02:45 PM
#12
SamF5 (Member)

Originally Posted by
bobliu
As with anything only testing will tell. Will work for great for some campaigns, maybe not so much for others. It adds a sense of urgency, 'oh look 27 people just signed up, I better get in before the next person'
As well, some advertisers will let you run a timer that goes upwards, rather than downwards. Depends on the advertiser and geo, but something else to test and work with. Same type of urgency
Home >
Programming, Servers & Scripts >