Kaye and Geoff's web page documentation
Note that the original rose image is displayed with a standard <img> tag:
The same technique can be used to allow mouseovers on one object to change an image on a different part of the screen. This can be a space-saving way of allowing people looking at your web page to control the images they see - for example in a pictorial or a technical presentation where multiple diagrams or graphs are used.... or for something a bit more lighthearted:
We have spent a lot of time trying to get around this problem, but have not come up with a satisfactory solution. The setTimeout function (it allows you to exit a function while automatically triggering another or the same function to run at a prescribed time in the future) can provide a solution but it usually requires that many variables which you would like to be local must in fact be declared globally, and generally makes a complex mess of carefully constructed code.
Time-dependent codeWe have all seen web pages with lists of "upcoming events", many of which are now well and truly in the past, or maybe "Merry Christmas to all our customers!" messages which are still on the page in March. Besides being useless information which tends to crowd out the relevant stuff, they give the impression (possibly with some truth) that the web site owners are lazy slobs who cannot be bothered to keep their web pages up to date. However, we web page maintainers lead very busy lives and it can be easy to forget that the friendly message or events we added a month ago have now outlived their usefulness.
We use the result returned by this function to control whether or not we create the HTML to display our message. The code is placed on the page where we want the message to appear, and it might look like the sample below. Up until the end of December 25, 2011, isFutureDate will return true so the page will say "Happy Christmas to all our friends!" but thereafter the function will return false and nothing will be displayed.
Variations on this theme could be used to make a message (or a link, or a picture or whatever) appear in the future, or on a particular day, or for a given period. Notices of annual events can be set up and will then appear and disappear at the correct times indefinitely and with no further interference.