View Full Version : Help!!


bagheera99
04-17-2003, 01:39 AM
Okay, here's what I want to do:

On the page http://www.angelfire.com/scary/sheepflock/sheepsflock.html , under where it says The Sheep's Flock in green type, I want to enter a couple things using JavaScript.

The first line under it, I would like it to say "Welcome, today is (auto insert current date here).

The line under that I'd like it to say a variety of things depending on the date. (all with X being the auto adjusted number of days until either July 16th or Aug 20th)
- from Sept 3nd until July 15th I'd like it to say "Only X more days until County Fair!"
- from July 16th until July 27th I'd like it to say "It's County Fair time!"
- from July 28th until Aug 19th I'd like it to say "ony X more days until State Fair!"
- from Aug 20th until Sept 2nd I'd like it to say "It's State Fair time!"

I hope I've been able to say what I need in a way that's understandable. I really hope somebody will be able to tell me how to do it.....

MaGiCSuN
04-17-2003, 05:26 PM
<SCRIPT LANGUAGE = "JavaScript">
var now = new Date();
// set this value to the countdown date.
var then = new Date("December 25, 2002");
var gap = then.getTime() - now.getTime();
gap = Math.floor(gap / (1000 * 60 * 60 * 24));
document.write(gap);
</SCRIPT>
day(s) Until whatever.

that's the normal countdown code. Unfortunately i don't know how to automatically change it sorry, but at least that is the code for a countdown

Love,
Mirna