HTML and CSS Reference
In-Depth Information
The following step enters the user-defined function restartFloat().
1
If necessary, click
line 35.
Enter the code shown
in Table 11-15
to create the
restartFloat() user-
defined function,
indenting as shown.
setTimeout() restarts
floating image by calling
the original user-defined
function
Press the
e n t e r key
twice to place the
insertion point on
line 39 (Figure 11-23).
press e n t e r
key twice
Figure 11-23
To Enter the coupon() Function
The fourth user-defined function added to the Gift Shop Web page is the coupon() function, which opens
the coupon pop-up window when the user clicks the floating image. Table 11-16 shows the code for the coupon()
function.
Table 11-16 Code for the coupon() Function
Line
Code
39
function coupon() {
40
window.open(“chapter11-1coupon.html”, “coupon”,
“width=525,height=360”)
41
}
Line 39 declares the function. Line 40 uses the open() method to open the Coupon Web page as a pop-up
window. The attributes settings size the window to a width of 525 pixels and a height of 360 pixels. This window
does not need any menu or scroll bars. Line 41 closes the function.
The following step enters the coupon() user-defined function.
1
If necessary, click
line 39 and enter
the code shown in
Table 11-16 to create
the coupon() user-
defined function,
indenting as shown.
opens pop-up window
with coupon
press the e n t e r key once
Press the
e n t e r key
once after line 41
(Figure 11-24).
Figure 11-24
 
Search WWH ::




Custom Search