Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make my counter look less fake?

Tags:

javascript

I'm using this bit of code to display the number of users on a site. My customer is complaining it looks fake. Any suggestions?

    var visitors = 187584;
    var updateVisitors = function()
        {
            visitors++;

            var vs = visitors.toString(), 
                 i = Math.floor(vs.length / 3),
                 l = vs.length % 3;
            while (i-->0) if (!(l==0&&i==0))
                vs = vs.slice(0,i*3+l)
                   + ',' 
                   + vs.slice(i*3+l);
            $('#count').text(vs);
            setTimeout(updateVisitors, Math.random()*2000);
        };

    setTimeout(updateVisitors, Math.random()*2000);

Edited:

alt text http://img695.imageshack.us/img695/4268/reachdevs2.png Screenshot-Advertise - Stack Overflow - Chromium http://img130.imageshack.us/img130/8083/screenshotadvertisestac.png

http://inedomedia.com/stackoverflow.aspx

like image 812
Eddy Pronk Avatar asked May 20 '10 03:05

Eddy Pronk


People also ask

Can you cover granite countertops?

Nearly any type of counter can be overlaid, as long as it is strong enough to support the overlay: tile, laminate, stainless steel, granite, quartz, concrete, and wood.


3 Answers

Everyone knows JS counters are fake, don't bother trying to make it look "less fake", bother making a real one.

If you don't have enough visitors to show around, just don't use a counter, they're so 90's.

like image 171
Ben Avatar answered Sep 27 '22 00:09

Ben


Warning: Attempted Humour

Did he ask for a giant splash page to go along with the fake real-time visitor counter? How about some nice "Netscape Now!" button logos and blinking text? Here are some really cool "under construction" animated gifs you can use too.

http://www.animatedgif.net/underconstruction/construction.shtml

-Oisin

like image 40
x0n Avatar answered Sep 26 '22 00:09

x0n


I'm guessing it looks fake because every time you load the page it starts at the same number and counts upwards?

Take a look at the javascript that tells you how many megabytes of email storage you get with a Gmail account. I think it bases the starting number on the date/time, so that if you load a page, watch it count up, and then load it again, it won't reload with a smaller number.

Be honest though... it is fake right? You aren't showing precisely how many users there are and updating it live as new users create accounts. The goal then is to make sure it is somewhat close to reality. Hopefully the rate at which the number increases in your script is based on past new-user subscription rates.

like image 43
Dan Avatar answered Sep 24 '22 00:09

Dan