Well ........ If you are using the 'normal' xxxT.htm template method of updating your website - things just got a whole lot more interesting
You don't even need to use JavaScript !
First of all the following assumes that you create a (web) directory called myimages.
<#isdaylight>
OK - let's say you would like a day or night image in the top right of your webpage.
First of all, you need to create a 'day' image, call it /myimages/daynight_1.gif (or jpg or png)
Then create a 'night' image, call it /myimages/daynight_0.gif
If you don't want one of the images, make it a small transparent gif or png
NB. Both images MUST be the same format !
Then between the <body> tag and <div id='content'> tags of your xxxT.htm file, you would need something like
Code: Select all
<!-- Daytime / night time graphic -->
<img src="myimages/daynight_<#isdaylight>.gif" style=" position: absolute; right: 5%; margin-top: 1%;" />
Job done !
If you would like to change your entire page background, that is a little bit different in the xxxT.htm code.
(I would recommend two jpg or png format images)
In the <head> section of your page you need to add some css code AFTER
<link href="weatherstyle.css" rel="stylesheet" type="text/css">
Like this:
Code: Select all
<link href="weatherstyle.css" rel="stylesheet" type="text/css">
<style type="text/css">
body {
background-image: url(images/daynight_<#isdaylight>.jpg);
}
</style>
Now for forecast images / icons !
<#forecastnumber>
There are actually 29 possibilities, 28 weather (including exceptional high / low), and one 'no data'
In your myimages directory, create the following images: (once again, format of your choice, as long as they are all the same)
weather_0.jpg - this could be a 'blank', means "Not Available"
weather_-1.jpg - this could be a copy of the next image, means Exceptionally Fine
weather_1.jpg
... These should be to suit forecast conditions 1 => 26
weather_26.jpg
weather_-26.jpg - this could be a copy of above, means Exceptionally Bad
You decide where you are going to put the image in your xxxT.htm file
Code: Select all
<img src="myimages/weather_<#forecastnumber>.jpg" alt="Station Forecast" title="Station Forecast" />
You can have different day / night forecast graphics (although strictly speaking the forecast is for some time in the future)
Create images as above, but called
for NIGHT graphics
weather_0_0.jpg
weather_0_-1.jpg
weather_0_1.jpg
..
weather_0_26.jpg
weather_0_-26.jpg
for DAY graphics
weather_1_0.jpg
weather_1_-1.jpg
weather_1_1.jpg
..
weather_1_26.jpg
weather_1_-26.jpg
html then becomes:
Code: Select all
<img src="myimages/weather_<#isdaylight>_<#forecastnumber>.jpg" alt="Station Forecast" title="Station Forecast" />
Edit: Not a good start, I got one of the webtags wrong