tag:blogger.com,1999:blog-8980734269859237005.post973548826196727151..comments2024-01-30T01:03:21.768-08:00Comments on DevCurry: Display a Running Counter Using jQuerySuprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-8980734269859237005.post-84308980103716036292011-07-13T08:23:15.052-07:002011-07-13T08:23:15.052-07:00Hi,
Nice peice of code.. just one query.
I used ...Hi,<br />Nice peice of code.. just one query.<br /><br />I used this code as <br /><br />Note: If no activity then this session will close automatically in &ltdiv id="displayCounter"&gt&lt/div&gt seconds.<br /><br />All in one line. But in the live page, it shows as<br /><br />Note: If no activity then this session will close automatically in<br />4<br />seconds. <br /BTR Naiduhttps://www.blogger.com/profile/07202631302916331395noreply@blogger.comtag:blogger.com,1999:blog-8980734269859237005.post-16539751935459561302011-05-19T10:50:46.932-07:002011-05-19T10:50:46.932-07:00Done it..
This code also pulls in the numbers to ...Done it..<br /><br />This code also pulls in the numbers to count to from a database.<br /><br /><br />$(function() {<br /> var cnt = 0;<br /> var counter = setInterval(function() {<br /> if (cnt < [cfdb-count form="*"]) {<br /> $('#displayCounter').html(commarise(cnt));<br /> cnt++;<br />Stuarthttps://www.blogger.com/profile/09159255582723147672noreply@blogger.comtag:blogger.com,1999:blog-8980734269859237005.post-76681567090170168442011-05-05T08:54:23.562-07:002011-05-05T08:54:23.562-07:00Only just coming back to this,
I tried this
$(f...Only just coming back to this,<br /><br />I tried this <br /><br />$(function() {<br /> var cnt = 990;<br /> var counter = setInterval(function() {<br /> if (cnt < 2000) {<br /> $('#displayCounter').html(cnt);<br /> cnt++;<br /> }<br /> else {<br /> clearInterval(Stuarthttps://www.blogger.com/profile/09159255582723147672noreply@blogger.comtag:blogger.com,1999:blog-8980734269859237005.post-68081255622973576682011-04-18T19:34:44.406-07:002011-04-18T19:34:44.406-07:00Thanks Stuart. You should take a look at the jQuer...Thanks Stuart. You should take a look at the jQuery Globalization Plugin (https://github.com/nje/jquery-glob) which will take care of string, date, and number formatting and parsing in your application.<br /><br />If you need anything simpler, there are plenty of scripts on the net that show you how to add commas to numbers. Check one here - http://stackoverflow.com/questions/1990512/Suprotim Agarwalhttps://www.blogger.com/profile/08349831623922214390noreply@blogger.comtag:blogger.com,1999:blog-8980734269859237005.post-79040115674003121232011-04-18T16:53:12.308-07:002011-04-18T16:53:12.308-07:00Hi Suprotim
Very nice piece of code.
One questio...Hi Suprotim<br /><br />Very nice piece of code.<br /><br />One question, is there any way to add a comma as a thousand separator?<br /><br />So that the numbers shown look like 2,000.<br /><br />Thanks<br /><br />StuartStuart Bainbridgehttp://code81.netnoreply@blogger.com