Metachecker.net
|
TrafficChecker.net
|
RankChecker.net
Learn Java Script Today
|
Over 5000 Free Fonts
|
Tutorials
|
Javascript Forum
|
Other Javascript Resources
|
Cheat Sheet
JavaScript Basics
Inserting Javascript
Complete Tutorial
Advance DHTML Tutorial
Script archive
Advanced Tutorials
Alert Scripts
Animation
Audio
Background Effects
Banner Ads
Browser Window
Buttons
Button Forms
Calculcators
Calendars
Clocks & Dates
Cookies
Cursor Effects
DHMTL Games
DHTML Miscellaneous
Equivalents
Forms
Games
IE4+ Scripts
IE5+ Scripts
Image Effects
Image Miscellaneous
Links & Buttons
Math Related
Messages Miscellaneous
Miscellaneous
Mouse Tricks
Navigation
Page Details
Password Protection
Pulldown Menus
Random Stuff
Scrolling
Status Bar
Text Animation
User Detail
User Info
Window Control
Background image to time of day
[View Sample]
A simple script changes the background image four times a day, depending on the time period.
Insert into <HEAD>
Insert into <BODY>
<script language="JavaScript"> <!-- Hide From Old Browsers /* ©1996-98 JavaScript written by Steve Thompson @ http://www.w8r.com --- e-mail: thompson@w8r.com or myclone@hotmail.com --- This simple script changes the background image four times a day -- It can be altered to include other page attributes such as text colors and individual page items such as on the example page - Use freely but keep this entire credit line intact. */ day=new Date() //..get the date x=day.getHours() //..get the hour if(x>=0 && x<4) { document.write('<body background="put your first image file name here such as 1.jpg">') } else if(x>=4 && x<12) { document.write('<body background="put your second image file name here such as 2.jpg">') } else if(x>=12 && x<18) { document.write('<body background="put your third image file name here such as 3.jpg">') } else if (x>=18 && x<24) { document.write('<body background="put your last image file name here such as 4.jpg">') } <!-- End Hiding --> </script>
Other Options