Linked Windows and Frames
Frames and Linked Windows2 Linked Windows n Information pointed to by hyperlink displayed in another window n Target attribute of anchor-tag target=window_name –If a window with name window_name exists, the document pointed to replaces the current contents of window window_name –If window with name window_name doesn't exist, a new window is opened with that name and filled with new document
Frames and Linked Windows3 Linked Windows n Target attribute of anchor-tag base target=window_name –Each anchor-tag without a target attribute will display the document it points to in window specified by window_name
Frames and Linked Windows4 Examples of Linked Windows target1.html Target Parent Window Open a new window called first_window. Open a new window called second_window. Load some new text into first_window.
Frames and Linked Windows5 Examples of Linked Windows target2.html Target First Window target3.html Target Second Window target4.html Target First Window But this time with new text.
Frames and Linked Windows6 Examples of Linked Windows target5.html Target Parent Window Target Parent Window Open a new window called first_window. Open a new window called second_window. Load some new text into first_window.
Frames and Linked Windows7 Frames n Frame definition document –Contains layout of each frame and names of HTML documents that will fill that frame
Frames and Linked Windows8 Frame Notation n … n … –Replace tag –A frameset is the set of frames defined by the tags in the frame definition document
Frames and Linked Windows9 Frame Notation <html><head> Page Title Page Title </head><frameset> Frame definition goes here </frameset></html>
Frames and Linked Windows10 Frame Notation n n –Width in pixels –Width in percent of total width –Width of as much space as possible
Frames and Linked Windows11 Frame Notation n n n "> –Associates html document with each frame </frameset>
Frames and Linked Windows12 Frame Notation n Attributes of -tag –scrolling="auto" n Default in Netscape n If frame contents take up more space than is available on frame, scrollbars are added –scrolling="yes" –scrolling="no"
Frames and Linked Windows13 Frame Notation n Attributes of -tag –noresize n By default, users can move borders of frames. This locks the frame borders. –marginheight=50 n Margin size in pixels which appears above and below document within a frame –marginwidth=60 n Margin size in pixels which appears on right and left of document within a frame
Frames and Linked Windows14 Frame Notation n … n … –In browser which doesn't support frames, you get only a blank page –This tag gives you content in this case
Frames and Linked Windows15 Frame Notation n … n … <html><head> Page Title Page Title </head><frameset> Frame definition goes here <noframe> Include any text, hyperlinks, and tags you want here </noframe></frameset></html>
Frames and Linked Windows16 Frame Notation </frameset> </frameset>
Frames and Linked Windows17 Frame Notation n n Naming frames – – n n Destination pages to be stored in named frames – – n n Magic target names – –target="_blank" n n Document referenced by -tag is loaded into a new unnamed window
Frames and Linked Windows18 Frame Notation n Magic target names –target="_self" n Document referenced by -tag is loaded into window or frame in which -tag resides –target="_parent" n Document referenced by -tag is loaded into parent of current document –If it has no parent, target="_self" is used –target="_top" n Document referenced by -tag is loaded into full browser window
Frames and Linked Windows19 Inline Frames n Microsoft Internet Explorer <iframe src="file.htm" width=75 height=200 align=right> Your browser doesn’t support inline frames. To view this document correctly, you’ll need a copy of correctly, you’ll need a copy of Internet Explorer. </iframe>