HTML and CSS Reference
EXAMPLE 10.12 ( CONTINUED )
4 <body onLoad = "startup()">
Get Dizzy. Watch the title bar and the status bar!!
This is the same program as Example 10.11 using the setInterval() method for set-
ting a timer. The function called startup() contains the code to start the scrolling.
The setInterval() method is a window method and is executed and calls scroller() at
intervals of 500 milliseconds (.5 seconds), and will continue to do so until the win-
dow is exited or the clearInterval() method is called. In Example 10.11 we used set-
Timeout() instead of setInterval() .
This is the scroller() f unction that creates the text in both the title bar and the sta-
tus bar. It is executed at .5 second intervals.
When the page has finished loading, the onLoad event handler will call startup() .
Figure 10.21 The string “ Only 19 shopping days left until Christmas! ” scrolls
continuously in the title bar and in the status bar. How annoying!
specified x/y coordinate pixel position. This method is only useful where there are areas of
the document not viewable within the current viewable area of the window. If you open
up another window, you might want to scroll to a particular place in the window based on
the user's selection from a menu in the main window, or you might want to use scrolling