View Full Version : Javascript counter
cipcip
Feb 21st 2009, 10:05 am
Ok, I am making a swoopo clone from scratch, i mean everyone knows the site www.swoopo.com
I have made everything but now, since i am not that good with javascript, i don't know how to do that counter that resets everytime a user press bid.
Any help / ideas ?
Thank you!
cipcip
Feb 24th 2009, 1:57 am
no one knows ? :(
cjburkha
Feb 24th 2009, 4:50 pm
Here is something kind of simple:
<html>
<head>
<script type="text/javascript">
function startTimer()
{
setTimeout(coutdown, 1000);
}
function coutdown()
{
var timeLeftObj = document.getElementById('timeLeft');
timeLeftObj.innerHTML = (parseInt(timeLeftObj.innerHTML) - 1);
startTimer();
}
function resetTimer()
{
var timeLeftObj = document.getElementById('timeLeft');
timeLeftObj.innerHTML = '100';
}
</script>
</head>
<body onload="startTimer();">
<input type="button" value="Reset!" onclick="resetTimer();" />
<br />
<span id="timeLeft" style="font-size: 32px; font-weight: bold;">100</span>
</body>
</html>
gruici
Mar 1st 2009, 9:23 am
i l give you the java code for 30 $ yahoo id:gruici_bogdan
Joak1m
Mar 4th 2009, 10:03 am
Use PHP and Ajax, much more reliable and reasonable.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.