2010-02-10, 04:19 PM
My first post here!
Im needing to find out how I can change an image by the hour. My idea is to have 24 ish images. These will reflect the time of day cycle so say for instance a user visits the forum at midnight, the background will be a moon lit sky. If the visit mid day it will be bright and sunny. Im not sure yet on wether id like it to be the logo that changes or the background but im liking more the idea of the background
so ill probably need
a folder that contains the 24 background images
the script/plugin/html that will load the image on a timer and also maybe
update the background
I dont care if this is automatic (real time) or just when a user first logs in
no replys yet but im trying to research on how to do it . since im crap with html or java its defo an eye opener! im kinda gearing towards something ive seen ...
<img id="hrimg" src="img0.jpg">
<script type="text/javascript">
document.getElementById("hrimg").src = "img" + (new Date()).getHours() + ".jpg";
</script>
You will want images named img0.jpg through img23.jpg, twenty-four in total, for each hour, where hour 0 is midnight to 0100.
now if im heading in the wrong direction on this one could someone give me a heards up ?
Im needing to find out how I can change an image by the hour. My idea is to have 24 ish images. These will reflect the time of day cycle so say for instance a user visits the forum at midnight, the background will be a moon lit sky. If the visit mid day it will be bright and sunny. Im not sure yet on wether id like it to be the logo that changes or the background but im liking more the idea of the background
so ill probably need
a folder that contains the 24 background images
the script/plugin/html that will load the image on a timer and also maybe
update the background
I dont care if this is automatic (real time) or just when a user first logs in
no replys yet but im trying to research on how to do it . since im crap with html or java its defo an eye opener! im kinda gearing towards something ive seen ...
<img id="hrimg" src="img0.jpg">
<script type="text/javascript">
document.getElementById("hrimg").src = "img" + (new Date()).getHours() + ".jpg";
</script>
You will want images named img0.jpg through img23.jpg, twenty-four in total, for each hour, where hour 0 is midnight to 0100.
now if im heading in the wrong direction on this one could someone give me a heards up ?