HTML and CSS Reference
In-Depth Information
2
Copy the HTML <table> code from lines 97 through 116 for the HTML code and mouse
event handlers for the navigation bar.
3
In the chapter11-1trails.html file, click line 60 and paste the code to create the
navigation bar.
4
Modify line 64 to replace the # symbol with chapter11-1homesolution.html .
5
Modify line 76 to replace the chapter11-1trailssolution.html with a # symbol.
6
In the chapter11-1homesolution.html file, copy the JavaScript code from lines 6 through
21. Return to the chapter11-1tours.html file and insert the copied code on line 6, and
then press the e n t e r key twice. Add the closing HTML comment ( //--> ) and the closing
</script> tags on lines 23 and 24 (Figure 11-29).
chapter1-1trail Web page
opens in Notepad++
JavaScript section with
code for navigation
bar image rollovers
Figure 11-29
Creating the popupCaption() User-Defined Function
The JavaScript code for the popupCaption() user-defined function is written in such
a way that it can be used for all pop-up captions. The function will accept two parameters
from the event handlers and display the appropriate pop-up caption. Table 11-18 shows
the JavaScript code used to create the popupCaption() function.
The eval() Statement
The eval() statement, short
for evaluator, executes
an expression as if it
were originally written
as language code. The
eval() statement is useful
in executing JavaScript
statements using data
whose value is not known
at the time the Web page
loads, such as the size of
a window.
 
Search WWH ::




Custom Search