Basically, this script is run every one second, which gives the illusion that the clock is actually ticking. However, with images, that's a little different. JavaScript with images, the key to mouseover, mouseout effects. Dynamically writing out html using JavaScript is very important-and powerful. In the last lesson, we showed how we could dynamically display one of the two images, depending on the day of time.
Lets have a look at another example that involves writing out the body tag dynamically.
In essence, it is a background image of a document that does not tile itself beyond the first screen, and stays static when the rest of the document scrolls up and down. Using watermarked backgrounds, you can have one big image that sits behind the background, and will not repeat itself to fit the entire document, creating a very unique and often beautiful look. However, many people are reluctant to use watermark backgrounds, since when Netscape users drops by, they will see one large image that is eager to reproduce itself-very ugly and unprofessional. By using JavaScript, however, we can easily control that, by dynamically using different backgrounds, depending on the browser type. Works with Internet Explorer.