Adjusting Frame Attributes

Team-Fly    

Macromedia® DreamWeaver® MX Unleashed
By Matthew Pizzi, Zak Ruvalcaba
Table of Contents
Chapter 7.  Framesets


An easy way to change the appearance of a frameset is to change the border size and color. You can easily change the size of the borders by entering a value in the Border Width field in the Properties Inspector when you have the frame selected. If you don't want borders, enter a value of 0. You can also choose No from the Border drop-down menu. If you choose Yes, you must enter a value greater than 0 for borders to appear in the browser. The final choice in the drop-down menu is Default. If you choose Default, the appearance of the border will be determined by the end user's browser.

There are also options for changing attributes of specific frames, such as the borders, border color, margin width, margin height, and more. To select an individual frame, click in whichever frame you want to select using the Frames panel. Notice in Figure 7.19 that whichever frame you select in the panel is the frame that the Properties Inspector provides options for.

Figure 7.19. When you click in a frame in the Frames panel, options for that particular frame become available in the Properties Inspector.

graphics/07fig19.jpg

Name

You can name each frame; however, do not confuse this with the filename or title of the document. This name simply helps identify the area of the frameset. This is extremely useful when linking documents to the frameset. It is also helpful when applying behaviors to links inside the frameset. It also allows JavaScript functions to be applied to specific frames, targeting them by frame name.

Avoid using spaces and special characters in your naming conventions. Also, never name a frame _blank, _top, _parent, _self. These are default target names that add functionality to linking frames and documents. For more information on this topic, refer to the linking portion of this chapter called "Targeting Frames."

Scroll

This option enables you to set the scrollbar for each frame. Often, designers like to have control over this option. A great deal of content might be in a particular frame, for example, and depending on the end user's screen size, you may want scrollbars to appear. This gives users the choice of using the scrollbar to reveal hidden content. Other times, a designer may not want scrollbars at all and opt for them to never show up. You can set that preference in the Properties Inspector using the following choices:

  • Yes This option creates scrollbars around the frame at all times. Unless you have a great deal of content in a frame, it's best visually not to choose this.

  • No This choice keeps scrollbars from ever appearing around the frame. Often, designers use this option to meet the needs of a specific design. Scrollbars can be a distraction to a particular layout or color scheme. If you can be sure that your content will remain visible on various monitors, use this option. If for any reason the content overflows the frame on a particular screen size, the end user has no way of viewing the hidden content.

  • Auto This choice offers the best of both worlds. Scrollbars appear only if necessary. Use this choice if the content in the frame yields unpredictable size results in a variety of browsers.

  • Default Whether the scrollbars appear is determined by the end user's browser.

Borders and Border Color

You can set the border size and color of the individual frame, regardless of the entire frameset's settings. This behaves much like borders for tables and table cells. However, if you're dealing with a nested frameset, there is a good chance the options you set here will affect the appearance of other frames within the document, because you're changing the <frameset> tag when changing settings in the Properties Inspector. If you have a frameset inside another, by changing the attributes of one tag, you can bet you're changing anything nested inside of it.

Frame Resize

If you are using borders, keep in mind that the default behavior inside the browser is having the capability to click and drag these frames to different sizes. As a developer, that's probably not what you had in mind.

If you set an absolute pixel value to one of the frames, the No Resize option is automatically checked. This eliminates the default resize behavior, so the end user will not be able to alter your design.

Margin Width and Height

Every HTML document has an offset, which means a small margin, only a few pixels wide, surrounds the entire document. With frames, it is common for a designer to want content from one frame to appear flush to the content of another frame. This is not possible with the default "cushion" around documents. To work around this, simply type in zeros for the Margin Height and Width text field options.

You can also get rid of the "cushion" in the Page Properties dialog box by choosing Modify, Page Properties.

Targeting Frames

Targeting frames is very important; this is what makes the frameset work. Creating hyperlinks in framesets entails one more step than a traditional link. You need to target which frame you want the linked page to load into. When you hyperlink a document, you highlight the text or graphic that you want the end user to click, and then type in a relative path to a local page or an absolute URL to link to an external site.

If that's all you did when linking in a frameset, without targeting, the page would load in the same frame as the hyperlinked item. For example, if there was a navigation system on the left side of the document, and I wanted a page to load into the main area, if I created a hyperlink without a target, you wouldn't get the results you were hoping for.

In the Target drop-down menu, you'll see the name of each frame within the frameset. The name refers to whatever you named the frame in the Properties Inspector. You'll also notice there are four default options as well.

  • _blank This target launches a new browser window when the hyperlink is clicked.

  • _parent This option opens the link in the parent frame of the frame the hyperlink is on. If, for example, you're inside a frame that is part of a nested frameset, it might not load in the top-level parent frame. Instead, it might load in the parent frame of the nested frame yielding undesired results. If you're not dealing with a nested frameset, this option behaves like _top.

  • _self This target opens the linked document in the frame in which it was called. This behaves much like not targeting the document at all.

  • _top This option wipes out the frameset and loads into the browser like a normal document.

By targeting documents and links properly, you should be able to create a successful frameset that offers an easier navigation system for the end user. After lining and targeting documents properly, you should get your desired results.


    Team-Fly    
    Top


    Macromedia Dreamweaver MX Unleashed
    Macromedia Dreamweaver MX 2004 Unleashed
    ISBN: 0672326310
    EAN: 2147483647
    Year: 2002
    Pages: 321

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