# Looking for a coutdown solution

**URL:** <https://www.ruby-forum.com/t/looking-for-a-coutdown-solution/186049>\
**Category:** Rails\
**Created:** [March 30, 2010, 9:39pm UTC](https://www.ruby-forum.com/t/looking-for-a-coutdown-solution/186049 "2010-03-30T21:39:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![remco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9d8465/32.png) [@remco](https://www.ruby-forum.com/u/remco)\
**Post date:** [March 30, 2010, 9:39pm UTC](https://www.ruby-forum.com/t/looking-for-a-coutdown-solution/186049/1 "2010-03-30T21:39:48Z")

</div>

Hi,

i am looking for a coutdown solution. When a product is created in my  
database a coutdown starts. The countdown is presented to visitors on my  
website.

Someone ideas, links ?

grtz…remco

---

<div class="post-metadata">

**Author:** ![remco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9d8465/32.png) [@remco](https://www.ruby-forum.com/u/remco)\
**Post date:** [March 31, 2010, 10:01am UTC](https://www.ruby-forum.com/t/looking-for-a-coutdown-solution/186049/2 "2010-03-31T10:01:33Z")

</div>

[http://keith-wood.name/countdown.html](http://keith-wood.name/countdown.html)  
I’ve used that before on my auction app. It workd pretty well.

Viola

---

<div class="post-metadata">

**Author:** ![remco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9d8465/32.png) [@remco](https://www.ruby-forum.com/u/remco)\
**Post date:** [March 31, 2010, 1:43pm UTC](https://www.ruby-forum.com/t/looking-for-a-coutdown-solution/186049/3 "2010-03-31T13:43:43Z")

</div>

Viola wrote:

> [jQuery Countdown](http://keith-wood.name/countdown.html)  
> I’ve used that before on my auction app. It workd pretty well.
> 
> Viola

I am a newbie…can you show me a code example how i can integrate this  
script with a db-record

Thanks…advance!

remco

---

<div class="post-metadata">

**Author:** ![remco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9d8465/32.png) [@remco](https://www.ruby-forum.com/u/remco)\
**Post date:** [March 31, 2010, 3:57pm UTC](https://www.ruby-forum.com/t/looking-for-a-coutdown-solution/186049/4 "2010-03-31T15:57:04Z")

</div>

Remco S. wrote:

> Viola wrote:
> 
> > [jQuery Countdown](http://keith-wood.name/countdown.html)  
> > I’ve used that before on my auction app. It workd pretty well.
> > 
> > Viola
> 
> I am a newbie…can you show me a code example how i can integrate this  
> script with a db-record

What bit are you having difficulty understanding?

- Create a product initializing an expiry datetime value
- Read the expiry datatime and pass that to the countdown JavaScript
- Use the passed in expiry datetime to initialize the countdown timer

The rest of what you need to know is shown in example code on the  
control’s home page.

---

<div class="post-metadata">

**Author:** ![remco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9d8465/32.png) [@remco](https://www.ruby-forum.com/u/remco)\
**Post date:** [March 31, 2010, 4:21pm UTC](https://www.ruby-forum.com/t/looking-for-a-coutdown-solution/186049/5 "2010-03-31T16:21:30Z")

</div>

pretty cool - is there a way to change the background color the closer  
the  
counter get to zero?  
thx
