I seen the how to instruction on the images change with the time of day
I'm just a beginner and don't understand much of nothing
can some one help to make this easy as possible for me?
it say:
"Now that you have the image, the next step is to copy the following script and attach it to the head section of your page.
// Time of Day Image Script
// copyright Stephen Chapman, 20th Jan 2005
// you may copy this script but please keep the copyright notice as well
function timeOfDayImage() {
var now = new Date;
var timeNow = now.getHours();
var img = null; var mess = '';
if #timeNow < 4 || timeNow > 20# {
img = 'time1#gif'; mess = 'night';
} else if #timeNow < 6# {
img = 'time2#gif'; mess = 'dawn';
} else if #timeNow < 8# {
img = 'time3#gif'; mess = 'early morning';
} else if #timeNow < 11# {
img = 'time4#gif'; mess = 'morning';
} else if #timeNow < 13# {
img = 'time5#gif'; mess = 'noon';
} else if #timeNow < 16# {
img = 'time6#gif'; mess = 'afternoon';
} else if #timeNow < 18# {
img = 'time7#gif'; mess = 'late afternoon';
} else {
img = 'time8#gif'; mess = 'sunset';
}
document#write('<img src="graphics\/'+img+'" width="200" height="80" alt="'+mess+'"
title="'+mess+'" />');
}
Then say:
"Once you have copied the code you just save it to an external javascript file. I called mine tod.js. You then link it into the head of your page using the following code:"
<script type="text/javascript" src="tod.js">
</script>
My first question is: If i copy the first code, how do I attach it in to Head ?
then it say in the baton - something about an External file and to link it to the second code,
How to do this?
If you like to see the whole thing
I got this script from this page:
http://javascript.about.com/library/bltod3.htm
Can some one make this as Easy as possible for me.
I'm a rooky, if some one can make it an Easy Step by Step
or put it together for me to just copy it and paste it on the the page.
PS. Please excuse my English.
I'm just a beginner and don't understand much of nothing
can some one help to make this easy as possible for me?
it say:
"Now that you have the image, the next step is to copy the following script and attach it to the head section of your page.
// Time of Day Image Script
// copyright Stephen Chapman, 20th Jan 2005
// you may copy this script but please keep the copyright notice as well
function timeOfDayImage() {
var now = new Date;
var timeNow = now.getHours();
var img = null; var mess = '';
if #timeNow < 4 || timeNow > 20# {
img = 'time1#gif'; mess = 'night';
} else if #timeNow < 6# {
img = 'time2#gif'; mess = 'dawn';
} else if #timeNow < 8# {
img = 'time3#gif'; mess = 'early morning';
} else if #timeNow < 11# {
img = 'time4#gif'; mess = 'morning';
} else if #timeNow < 13# {
img = 'time5#gif'; mess = 'noon';
} else if #timeNow < 16# {
img = 'time6#gif'; mess = 'afternoon';
} else if #timeNow < 18# {
img = 'time7#gif'; mess = 'late afternoon';
} else {
img = 'time8#gif'; mess = 'sunset';
}
document#write('<img src="graphics\/'+img+'" width="200" height="80" alt="'+mess+'"
title="'+mess+'" />');
}
Then say:
"Once you have copied the code you just save it to an external javascript file. I called mine tod.js. You then link it into the head of your page using the following code:"
<script type="text/javascript" src="tod.js">
</script>
My first question is: If i copy the first code, how do I attach it in to Head ?
then it say in the baton - something about an External file and to link it to the second code,
How to do this?
If you like to see the whole thing
I got this script from this page:
http://javascript.about.com/library/bltod3.htm
Can some one make this as Easy as possible for me.
I'm a rooky, if some one can make it an Easy Step by Step
or put it together for me to just copy it and paste it on the the page.
PS. Please excuse my English.
Comment