There is a nice plugin called the Cycle Plugin for JQuery.
http://www.malsup.com/jque
It's set up for images on the demo, but I use it for scrolling customer quotes (text) on marketo.com. You can use it for this counter too. Gives some nice options for effects too.
Use the plugin, to cycle through 2 divs with the same content, and on change, just increment the number.
Main Topics
Browse All Topics





by: ragerinoPosted on 2008-02-02 at 07:19:50ID: 20804592
do i understand you right. you have a website that has some start variable and calcualtes the time until now in seconds and divides this number through 3.6 and this number is displayed in the browser?
why don't you do the calcualation and the displaying of the number in the browser. some kind of counter.
for this you wouldn't need a server-request every 3.6 seconds.
otherwise if you want to push information to browsers you should have a look at the comet/bayeux-procol :
http://www.cometd.com/
the code for a counter would look something like this (i don't know the jquery-framework, so i'm using document.getElementById ...)
the code is not tested. it should just give you an idea how to get this done.
Select allOpen in new window