Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Javascript counter ticker showing total of online web users
Old 11-13-2010, 06:28 AM Javascript counter ticker showing total of online web users
Skilled Talker

Posts: 81
Trades: 0
I'd like to construct a ticker showing the number of current people online AND making it tick up each second by the known increase.

I already have a ticker for the number of mobile phones sold since a visitor opens a webpage:

Code:
function plusOne() {
var inputEl = document.getElementById('inputEl');
inputEl.value = parseInt(inputEl.value) + 1;
    }
var stop = setInterval("plusOne()",0033);
window.onload = plusOne;
But that starts at a zero base level.


So I'd like to make a script to

a) specify a base level of say 2 billion, for a particular recent date when the
stat experts say was that tipping point.

b) work out how many milliseconds have elapsed since that date up to today's
date and time

c) divide that by the known number of new people going online. Let's say one new
person every 250 milliseconds. Then add that total of people since the specificed date to the base level.

d) that creates a base level of slightly over 2 billion as a starting point for when
the page is opened.

e) then have that number continue to tick up at 4 more every second using code
similar to what I have above.

I'm sure the sums can be done with stuff like var d = new Date();
and
var ms = (Date.parse(d));

but I'm not up to knowing how!

Thanks for any pointers in the right direction.


Tony
__________________

Please login or register to view this content. Registration is FREE
soon is offline
Reply With Quote
View Public Profile Visit soon's homepage!
 
 
Register now for full access!
Reply     « Reply to Javascript counter ticker showing total of online web users
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.17439 seconds with 12 queries