The Featured Book

[ LiB ]

The Featured Book

When a visitor clicks on the link for the featured book, a new window measuring 640 pixels wide by 420 pixels high opens, and the Web page for the site's featured book is loaded into it. This page contains only HTML, although you might want to add a little JavaScript that uses mouse events to display more detailed information about the book by opening a new window. You might also want to display a message that explains what the rating system is when the visitor moves the pointer over the graphic rating. This could be done using the ALT attribute of the <IMG> tag, by using JavaScript to open a new window, or by enabling the status bar and posting messages to it. The HTML statements that make up this page are listed here:

Figure 5.11. Because of its role as home page, a site's index page is often one of the more lengthy and complex pages, involving heavy use of JavaScript.

graphic/05fig11.gif


 <HTML>   <HEAD>     <TITLE>Script 5.9 - This month's featured book</TITLE>   </HEAD>   <BODY>     <CENTER>       <H2 ALIGN="left"><IMG BORDER="0" HEIGHT="78" SRC="bstorelogo.jpg"         WIDTH="636"></H2>     </CENTER>      <H2 ALIGN="center"><FONT COLOR="#ff0000">This month's featured book:</FONT></H2>     <P ALIGN="center"><IMG BORDER="0" HEIGHT="209" SRC="html- book.jpg"        ALT="Learn HTML In a Weekend" WIDTH="165"></P>       <CENTER>       Learn HTML In a Weekend is your ultimate source for HTML programming.       <B>Rating:</B>         <IMG ALT="" BORDER="0" HEIGHT="15" SRC="star.gif" WIDTH="14">         <IMG ALT="" BORDER="0" HEIGHT="15" SRC="star.gif" WIDTH="14">         <IMG ALT="" BORDER="0" HEIGHT="15" SRC="star.gif" WIDTH="14">         <IMG ALT="" BORDER="0" HEIGHT="15" SRC="star.gif" WIDTH="14">         <IMG ALT="" BORDER="0" HEIGHT="15" SRC="star.gif" WIDTH="14">       </CENTER>   </BODY> </HTML> 

Figure 5.12 shows what the featured book page looks like when loaded.

Figure 5.12. Opening a new window is an effective presentation tool for placing extra emphasis on a specific page.

graphic/05fig12.gif


[ LiB ]


Learn JavaScript In a Weekend
Learn JavaScript In a Weekend, Second Edition
ISBN: 159200086X
EAN: 2147483647
Year: 2003
Pages: 84

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net