Targeting Windows

     

Targeting Windows

To effectively use frames , a designer must decide where linked pages will load. For example, you might have set up your frameset to contain a menu on the left and a larger frame field on the right. The goal is to ensure that the links in the menu always load in the content area, unless you want a different behavior.

The following are two basic ways to link, or target , documents to specific windows:

  • Combine target and name attributes to specifically target windows.

  • Use a reserved target name, such as self .

The target and name attributes enable you to add pages to your framed site and target a specific window by naming that window and targeting the link.

graphics/troubleshooting_icon.jpg

Trying to print out a frame in your framed page but having no success? See "Printing Frames" in the "Troubleshooting" section of this chapter.


Using the target and name Attributes to Link a Frame

To target a frame to open properly by using the target and name attributes, you first need to ensure that all your individual frames have been properly named in the frameset. Avoid naming standard targets with anything other than an accepted alphanumeric character; an underscore , or any other symbol, is ignored. Then, follow these steps:

  1. Select a link or linked object in the frame where you'd like the link to reside. In our example, that would be the left menu, which is named leftFrame .

  2. Provide the source file of the page you're going to have load in the main area by clicking the folder icon and navigating to the appropriate file.

  3. In the Property inspector, you'll find the Target drop-down menu. If you named all your frame files and are working in the frameset, the name of your frame should appear in the list. Because you want the linked page to load in the mainFrame frame (the one to the right), select mainFrame as your target.

The target element has now properly been added to the link. When you click the link, the page you want to load in the main frame will do so.

Using Reserved Target Names

As you look at the Target drop-down menu, you'll find several predefined target names that cause certain actions to occur when a target link is created:

  • target="_blank" ” The targeted document opens in a completely new browser window. Use this only when a new window is absolutely necessary; otherwise , you run the risk of irritating visitors , who, depending on their settings, might end up with numerous , resource-draining browser windows on the desktop. Also, some browser add-ins automatically stifle pop-up windows to block advertising.

  • target="_self" ” The targeted document loads in the same frame where the originating link exists.

  • target="_parent" ” This loads the targeted document into the link's parent frameset.

  • target="_top" ” Use this attribute to load the link into the full window, overriding any existing frames. This is usually the correct choice when a link takes the visitor out of your framed site into a new site.



Using Macromedia Studio MX 2004
Special Edition Using Macromedia Studio MX 2004
ISBN: 0789730421
EAN: 2147483647
Year: N/A
Pages: 339

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