2.3 Images and Image MapsDreamweaver allows you to work with web-compatible images (GIFs, JPEGs, and PNGs) in a variety of ways, including:
2.3.1 Inserting ImagesInsert images using Insert Image or by clicking the Insert Image icon in the Objects panel's Common category. In the Select Image Source dialog box, shown in Figure 2-8, select the file to link to, or enter the image's URL manually. Choose Relative To Document from the pop-up menu to create a URL relative to the current document. Choose Relative To Site Root to create a URL relative to the root folder of the site. To create an absolute URL, specify the entire path, including the server, such as http://www.macromedia.com/data/images/biplane.gif. Use the Preview Images checkbox to preview both local and remote files. Figure 2-8. The Select Image Source dialog boxOnce an image is inserted, use the Property inspector to set the <img> tag's options. Figure 2-9 shows the Property inspector when an image is selected. Double-clicking an image in the Design view opens the Property inspector and prompts you to reselect an image file for the src attribute of the <img> tag. Figure 2-9. The Property inspector for imagesTable 2-5 explains the Property inspector options for images.
The ten possible values for the Align option are:
Any image added to a document is automatically added to the Site list of the Assets panel's Images category. Images from the Assets panel can be inserted into other documents as described in Chapter 6. 2.3.2 Client-Side Image MapsA client-side image map uses a <map> tag (see Example 2-1) to define multiple clickable areas, each with a separate link, for a single graphic image. The browser detects which link was clicked before contacting the server to fulfill the request. Each image can be tied to one <map> tag only unless it is controlled by a script. Use the Property inspector's rectangle, oval, and polygon tools to draw hotspots (clickable regions) for your image map, as shown in Figure 2-10. Figure 2-10. A client-side image map drawn using the Property inspector's hotspot toolsUse View Visual Aids Image Maps to show or hide the hotspot regions (which ordinarily appear in light blue). Enable the Edit Preferences Invisible Elements Client-Side Image Maps checkbox to show a small icon representing the <map> tag. You can specify the following settings for each hotspot:
Example 2-1 shows a simple image map using the <area> element to define the multiple clickable areas of the image. As usual, you can use Dreamweaver's visual tools while it handles the housekeeping chores for you. Example 2-1. Client-side image map<img src="/data/images/pagetop.gif" width="400" height="100" align="bottom" border="0" usemap="#cbcmap"> <map name="cbcmap"> <area shape="rect" coords="4,4,55,100" href="logo.html" alt="home page" title="home page"> <area shape="rect" coords="88,9,364,53" href="catsback.html" alt="company info" title="company info"> </map> 2.3.3 Rollover Images and Navigation BarsDreamweaver can create rollover images and navigation bars without requiring hand coding. Chapter 13 takes a deeper look at rollover images and navigation bars, but this section covers their basic use. 2.3.3.1 Rollover imagesRollover images provide a rollover state for your page's buttons and are inserted using Insert Interactive Images Rollover Image. The button's two states are defined in the Insert Rollover Image dialog box, as shown in Figure 2-11. If the mouse is over the image, the Rollover Image graphic is displayed; otherwise, the Original Image graphic is displayed. Rollover images work only in browsers that support JavaScript (see Table 12-1 and Table 12-3). For browsers that don't support JavaScript, or if the user has disabled JavaScript, the browser always displays the Original Image graphic. Figure 2-11. The Insert Rollover Image dialog boxThe Insert Rollover Image dialog box has five options, as shown in Table 2-6.
Both images used in your rollover effect should be the same size; otherwise, the Rollover Image graphic is scaled to fit the area taken up by the Original Image graphic. Chapter 13 explains how to create so-called disjoint rollovers in which rolling over a button changes a separate page element. 2.3.3.2 Navigation barsYou can create a navigation bar with multiple buttons, as shown in Figure 2-12, by using Insert Interactive Images Navigation Bar. Figure 2-12. An example navigation barA navigation bar automatically shows the button for the current page in the highlighted (down) state to indicate which page the user is viewing.
In the Insert Navigation Bar dialog box, shown in Figure 2-13, use the plus (+), minus (-), and arrow buttons to add, remove, or rearrange elements (i.e., buttons) in the Nav Bar Elements list. Figure 2-13. The Insert Navigation Bar dialog boxThe last two options in the dialog box (and in Table 2-7) apply to the navigation bar as a whole. The rest of the attributes in Table 2-7 pertain to each navigation bar element. Highlight each element in the Nav Bar Elements list to set its attributes.
To modify an existing navigation bar use Modify Navigation Bar, or select Insert Interactive Images Navigation Bar and click OK when asked if you wish to modify the existing navigation bar. Chapter 13 explains additional navigation bar configuration options, including how to access the advanced configuration options shown in Figure 13-6. 2.3.4 Web Photo AlbumThe Web Photo Album option creates a document showing all images stored in a single directory, which is ideal for images from your latest vacation, business convention, or dog show. To create a Web Photo Album, select Commands Create Web Photo Album.
The Create Web Photo Album dialog box is shown in Figure 2-14. Figure 2-14. The Create Web Photo Album dialog boxTable 2-8 explains the Create Web Photo Album dialog box's options.
Fireworks may take a few minutes to process the images. Figure 2-15 displays a completed Web Photo Album showing five columns of 100 x 100 thumbnails. Each thumbnail leads to a larger version of the same image. Figure 2-15. A completed Web Photo AlbumTo run the Web Photo Album command, you must have a document from the current site open in the Document window. If successful, the command creates an index.htm file plus three folders—named images, pages, and thumbnails—in the destination folder you specify. The file extension of the HTML files created by Fireworks is determined by Fireworks' preference settings, not Dreamweaver's preferences. If you intend to change your photo album pages, you should see Chapter 8; templates are easier to update than the static pages created by the Create Navigation Page for Each Photo option. |