EasyCFM.COM ColdFusion Forums / Tutorial Requests! / Making a timer in coldfusion to switch images

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Making a timer in coldfusion to switch images

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

Epidemik
08-05-2011 @ 3:14 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 42
Joined: Nov 2007

I am trying to make a timer that switches images based on the time and day and has a countdown timer til the item is not on sale anymore.  Would i have to use jquery to refresh the image without refreshing the whole page?  What would be the best way to go about this?

Thank you in advanced

MIGhunter
08-05-2011 @ 11:54 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 570
Joined: Apr 2006

You could calculate the difference between now and the
date in question.  If it is a positive number then set
your main picture preview the pictures based on the
time of day with the now() function.  If you number the
pictures instead of naming them, you can use random to
display them randomly.  As for having them change
without the page refreshing, you would need javascript
for that.  Unless you use an iframe and have that page
refresh separately from the main page.

Here is a nice way to calculate time between dates:
http://www.bennadel.com/blog/1318-Ask-Ben-Displaying-
And-Formatting-The-Difference-Between-Two-Dates.htm



Epidemik
08-08-2011 @ 1:13 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 42
Joined: Nov 2007

Ok cool, so one question i have what if the user comes after the bidding starts.  Will it have the timer started already or will i have to do something else to effect the time on when ever they come in?


Website Designed and Developed by Pablo Varando.