170 likes | 325 Views
Frames. Purpose to split a screen into two or more independent windows, each capable to displaying its own page. Common use to divide a screen into two windows left window serving as a navigation guide and right window showing the contents of a particular page. Examples.
E N D
Frames • Purpose • to split a screen into two or more independent windows, each capable to displaying its own page. • Common use • to divide a screen into two windows • left window serving as a navigation guide and • right window showing the contents of a particular page
Examples • HTML Frame Examples • Java Class Library
Frame Pages • At least 3 separate pages are required to use frames. • Frameset page , which indicates how many frames and describes their layout • Navigation page, which contains a list of links to various pages to be shown in the contents frame Content page, which will display the contents of linked pages
Frameset <html> <head><title>Frameset Demo</title></head> <frameset cols="180,420"> <frame name=navigate src="framenav.html"> <frame name=content src="frameWelcome.html"> </frameset> <body bgcolor="#ffffff"> <noframe>This page requires a browser that supports frames. </noframe> </body> </html>
Specifying Frame Size by % <html> <head><title>Frameset Demo</title></head> <frameset cols=”44%,*"> <frame name=navigate src="framenav.html"> <frame name=content src="frameWelcome.html"> </frameset> <body bgcolor="#ffffff"> <noframe>This page requires a browser that supports frames. </noframe> </body> </html>
Navigation Frame <html> <head><title>Navigation Page</title></head> <body bgcolor="#ffffff"> <h2>Navigation Frame </h2> <h3>Animal Farm</h3> <ol> <li><a href="frameAnimals.html“ target="content">Apes</a> <li><a href="frameAnimals.html#bears" target=content>Bears</a> <li><a href="frameAnimals.html#cheetah" target=content>Cheetah</a> <li><a href="frameAnimals.html#dogs" target=content>Dog</a> </ol>
<h3>Plant Farm</h3> <ol> <li><a href="framePlants.html" target=content>Anthuriums</a></li> <li><a href="framePlants.html#bonsai" target=content>Bonsai</a></li> <li><a href="framePlants.html#cabbages“ target=content>Cabbages</a></li> </ol> </body> </html>
Targeting to a Specific Frame • Targetting to Content Frame • Not targetting to Content Frame • Targetting to Parent Frame
Targetting to Various Frames <body bgcolor="#ffffff"> <h2>Navigation Frame </h2> <h3>Animal Farm</h3> <ol> <li><a href="frameAnimals.html" target="content">Apes</a> <li><a href="frameAnimals.html#bears">Bears</a> <li><a href="frameAnimals.html#cheetah” target="_parent">Cheetah</a> </ol>
Page With 3 Frames <html> <head> <title>Multiple Frames (3)</title></head> <frameset rows="80,*"> <frame name="banner" src="frameBanner.html"> <frameset cols="180,420"> <frame name=navigate src="framenav.html"> <frame name=content src="frameWelcome.html"> </frameset> </frameset> <body bgcolor="#FFFFFF"> </body> </html>
Page With 4 Frames <html> <head><title>Multiple Frames (4)</title></head> <frameset rows="15%,70,15%"> <frame name="banner" src="frameBanner.html" scrolling=no noresize> <frameset cols="180,420"> <frame name=navigate src="framenav.html” border=0> <frame name=content src="frameWelcome.html” border=0> </frameset> <frame name="footer" src="frameFooter.html” scrolling=no noresize> </frameset> <body bgcolor="#FFFFFF"> </body> </html>
Frame Attributes • Default Frames • No Border • (frameborder="0" in both FRAME & FRAMESET) • No Scrolling • (scrolling="no" in FRAME) • No Resize • (noresize in FRAME)
Default Frames <frameset rows="70,*"> <frame name="banner" src="frameBanner.html"> <frameset cols="180,420"> <frame name=navigate src="framenav.html"> <frame name=content src="frameWelcome.html"> </frameset> </frameset>
No Border <frameset rows="70,*" frameborder="0"> <frame name="banner" src="frameBanner.html"> <frameset cols="180,420"> <frame name=navigate src="framenav.html"> <frame name=content src="frameWelcome.html"> </frameset> </frameset>
No Scrolling <frameset rows="70,*" > <frame name="banner" src="frameBanner.html"> <frameset cols="180,420"> <frame name=navigate src="framenav.html"> <frame name=content src="frameWelcome.html” scrolling="no"> </frameset> </frameset>
No Resizing <frameset rows="70,*"> <frame name="banner" src="frameBanner.html” noresize> <frameset cols="180,420"> <frame name=navigate src="framenav.html"> <frame name=content src="frameWelcome.html"> </frameset> </frameset>