Mar
06Web 2.0 Countdown Timer (for eBay)
Hey eBay, I have something for you. The other night I mentioned that you need to catch up with the times and implement some Web 2.0 elements on your site. I hate that in 2007 I still have to refresh the final minute of an auction. We are all Sniping the auctions anyway. It's just a matter of watching the last final minute. If I had to continuously press a button during the last leg of Kentucky Derby I would spend all my time, before the Preakness, figuring out how to automate that ridonkulous procedure.
So this is for you, eBay.
Put this code in the <head> // probably should go in its own js file
<script type="text/JavaScript">
function CountDown(x){
total = (60 - x);
document.getElementById('counttimer').innerHTML = total + " seconds remaining";
x++;
x = (x == 60) ? 0 : x;
setTimeout("CountDown("+ x +")", 1000);
}
</script>
Somewhere after the <body> add this:
<p id="counttimer"></p>
Add this piece (below) after the id is set. This is very important. The function can actually sit anwhere on the page. The Page DOM must contain the id before the function is called.
<script type="text/JavaScript">CountDown(1)</script>
That's it. A Web 2.0 Countdown Timer that doesn't use a form, input text fields, hidden fields or 65 lines of code. I have noticed you are dabbling in the Web 2.0 world with the use of Grebox. I am a big fan of Greybox and have been using it to display the comments for almost a year. Come on, eBay. It's time to catch up to at least the standards of What Da Phuk!
January 31st, 2008 at 10:14 pm
when i press F5 key for refresh the page timer time starts from begin, but i want that timer time start from that time means when i press F5 key it store that remaining seconds and start from that second..
pls give me the solution for that….
please help me out!
February 1st, 2008 at 3:55 am
use onkeypress (for F5) to store the current remaining time in a cookie. At the beginning of the timer, always check to see if the cookie has a value. If it does, use that time instead.