New Topic Reply Subscription Options |
Countdown clock - Javascript, foolproof
Forums: Suggestions and Feedback | |||
|
|||
Participant: Log in to see names |
Sunday, July 18, 2010 at 3:37 AM
Hi, Brad -- Back in December 2009 I posted the Topic, shown below. From all the talk about how unreliable and difficult the countdown clocks that people were using are, I figured an embedded countdown clock would be something folks would be interested in. But no replies, so what can I say. To see what the countdown clock in action, go to our homepage, www.cheltenhamhs.com Our Reunion is just 83 days away, and I'll be taking this feature off our website when our Reunion has come and gone. (Or will perhaps reverse it, as "It's been 207 days since our Reunion.") If you want to see it, go there now. It seems that this would be a good addition to the ClassCreator feature set. And it seems like it would be easy to implement. How about it ? Cheers,
Hello -- If you are comfortable with copying-and-pasting some javascript into your source code, you can do what I did. It shows up as: The "285" figure is embedded as a javascript variable in the source code, and is the countdown figure -- it changes automatically each day. To do this, you need to know how to edit the source code. today = new Date(); target = new Date("09 October, 2010"); daysLeft = Math.floor(1 + ((targetEpoch - todayEpoch) / (60*60*24)) / 1000); .
Then, go back to the source code, and enter the following: <script>document.write(daysLeft);</script> in-between the "Just" and the "days" Just <script>document.write(daysLeft);</script> days to go Save it, and that's it. You may have to add a space in front of the word "days" to get it to look right.
|
||
|
|||
Participant: Log in to see names |
Sunday, July 18, 2010 at 10:45 AM - Response #1
Thanks Fred! A nice and simple solution.
|
||
|
|||
Participant: Log in to see names |
Sunday, July 18, 2010 at 11:17 AM - Response #2
Thank you, Brad. I see it as a simple and easy-to-implement solution. Everyone complained so much about the third-party clocks. It doesn't look like anyone has incorporated it, though. If you want to promote it as coming from Brad, feel free. It seems like some people would jump on it. The original code did not have the "1 +" in the "daysLeft = Math.floor(1 + ((targetEpoch - todayEpoch) / (60*60*24)) / 1000);" line -- I added that, to coincide with a finger count on the calendar. So you may want to check the math for accuracy. I don't know javascript at all. I just search on the Internet until I found this. It seems like a "missing" feature for you -- so perhaps you can install an easy button somehow, in your spare time. You do know that your messages are double-posted, yes ? Another feature on my home page -- I searched and searched for a slideshow photo display that would present the images in a RANDOM sequence. All the ones I found, both big and small, will display the same sequence again and again. That's no good if you've got 200 photos and people visit the site for 5 or 10 minutes -- they'll see the same photos over and over. A friend/classmate who *is* a programmer supplied the code on my home page. It's a little clumsy in that I had to set up the photos with numbered filenames, and I had to supply a manual count. So it's not ready for prime time. The concept, though, should be copied -- it should be available by the big boys. To me, not having a random display is absurd. It is a very practical need. If you choose to build on this javascript random photodisplay, or if you or another programmer looks at it, I'd have this question: The programming is simple, and it apparently uses a random generator function to pluck out the number... but if you watch the display it seems anything but random. The same image may come up 3 times in a few minutes, while others are neglected. If you built on it, you'd want to have a pause button, and (shouldn't be too hard) keep a memory of the past 10 or 20 random numbers in array so the viewer could have a Back button also.
Cheers and thanks,
|
||
|
|||
Participant: Log in to see names |
Sunday, July 18, 2010 at 11:19 AM - Response #3
Great! Love it.
|
||
|
|||
Participant: Log in to see names |
Sunday, July 18, 2010 at 1:02 PM - Response #4
We can add a random option to Gallery Creator, sure. We'll also add a code generator so you can generate your own code and thereby paste photo gallery slideshows embedded on other pages of your site.
|
||
|
|||
Participant: Log in to see names |
Sunday, July 18, 2010 at 1:06 PM - Response #5
I didn't think it would be difficult. I was highly surprised that I found nothing that would do this. Not with commercial photo sites, nor in the javascript forum world. Way to go, Brad !
|
||
|
|||
Participant: Log in to see names |
Sunday, July 18, 2010 at 1:09 PM - Response #6
On second thought, I don't think we should add this directly to Gallery Creator. It would be strange to click a photo to launch a slideshow and then have the photos not play in sequence. What if the user wants to play them in sequence and the admin has set them to random? With Gallery Creator you can choose to start the show on any particular picture of your choosing anyway, so you could easily play any unseen part of the slideshow. Only other alternative is putting a random button above the photo thumbs for every user, which I think would be clunky when they already have full control over this anyway. I do think we should add the option on the embed code generator so you can display your own slideshows embedded on other pages though. There the user would have less control, is likely to be on the page for less duration as you noted, and it makes perfect sense in this capacity.
|
||
|
|||
Participant: Log in to see names |
Sunday, July 18, 2010 at 8:36 PM - Response #7
Heh, we've used the same Javascript countdown clock on our website for a while. Well it's maybe a minor variation, I've simplified the wording around it over time. Coincidentally, we're having our 40th in 2 weeks, and I have the same Einstein thing, with different text, on our website
|
||
|
|||
Participant: Log in to see names |
Monday, July 19, 2010 at 5:27 AM - Response #8
Hi, Allen -- Cheers,
|
||
|
|||
Participant: Log in to see names |
Tuesday, July 27, 2010 at 9:56 PM - Response #9
Thank you, the countdown clock works!
|
||
|
|||
Participant: Log in to see names |
Wednesday, July 28, 2010 at 1:32 AM - Response #10
Great, Jill -- looks good ! So either put an exclamation point before the final ">" Have fun at your reunion !
|
||
|
|||
Participant: Log in to see names |
Sunday, September 19, 2010 at 9:07 PM - Response #11
Fred, We are having our 30th reunion Oct. 15-17th. I tried the code but it did not appear making the modification that you mention. Please confirm if I am to copy this in a new link on the homepage for it to display. Thanks
|
||
|
|||
Participant: Log in to see names |
Sunday, September 19, 2010 at 9:25 PM - Response #12
Hi, Sheila -- I can't comment too much on what you've done, because I can't see the code on your home page. The code is pasted in on the Source code -- do you know your way around HTML ? If not, then I wouldn't recommend that you use it. If you want, you can give me a log-on e-mail address and a password (or a temporary password), and I'll put it in for you. If you do this, tell me just where you want it, and how you want it to read, the font size and color, and so forth. It shouldn't take me more than a few minutes to plug it in. I'll send a private e-mail to you that you can respond to. Cheers,
|
||
|
|||
Participant: Log in to see names |
Wednesday, June 6, 2012 at 9:37 AM - Response #13
I would be interested in the Java script and suggestions on where to put it. Claudia Jones
|
||
|
New Topic Reply |
Subscription Options: Have all new forum posts sent directly to your email. |
Subscription options are available after you log in. |