We accept safe and secure Credit Card and PayPal Payments.
 
Perl Scripts

All Count
Attachment Mailer
Perl Scripts Build A FAQ Plus
Perl Scripts Clock In Center
eBackup Automated
Easy Poll
eSurvey
Fetch a File
Form Maker
Mailing List Server
MySQL Mate
PDF Creation
QCart
Quick Fix
Quote of the day
Speed Search
Task Manager
Traffic Pack
Upload Plus
Upload Gold
Upload Pro
Website Manager

 
Free Perl Downloads

Free Perl Scripts Main Page
Free Perl Scripts 404 Alerter
AccessLog Viewer
Build A FAQ
PHP Scripts eBackup
Free PHP Scripts ErrorLog Viewer
eVars - Server Info
HT Pass Creator
Upload Lite
Website Manager

 
JavaScripts

Free Java Scripts Alert Boxes
Free JavaScripts Browser Sniffer
Check email
Generators
Slide Show
Sudoku
Window Maker
More...

 
Extra Utilities

ASP Scripts Ascii Codes
Free ASP Scripts Color Picker
Font Finder
HT Pass Creator
Meta Cloak
Meta Magic
Pano Zooms
SlideShow
Server Size

 
Online Tutorials

Free HTML Scripts Glossary
Free HTML Scripts HTML
JavaScript
MySQL
SSI
Build Traffic
Other

 
Miscellaneous

About Us
Graphics
Testimonials
Installations
Latest versions

 
Hawk Eye in Tennis

Should Hawk Eye replace linesmen and lineswomen at all tennis tournaments?







 
View all Polls

Run Polls on your site

Run your own Surveys

 
Store Download FAQs Contact Us Support Programming Policies  
Contents Intro Your first page Text Images Links Lists Tables
Frames Forms Sounds Styles Symbols Colors Tags Publish Index

Chapter 7

Frames

Frames allow you to split the browsers window up in to as many sections as you like, each capable of displaying its own document. Usually used for displaying a list of Contents (Links) on left side of the browser, which once clicked, display a document on the right side. When using frames, it's important you use the <!Doctype html public "-//wc3/dtd html 4.0 Final//en"> tag. As frames were only recognized by the w3c (world wide web consortium) as of version 4, the doctype tag ensures the file is correctly interpreted.

Here is the full source code for a simple frameset.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Final//EN">

<HTML>
<HEAD>
<TITLE>Simple frameset</TITLE>

<FRAMESET cols="50%,50%"> <FRAME border="1" name="frame1" src="frame1.html"> </FRAME> <FRAME border="1" name="frame2" src="frame2.html"> </FRAME> </FRAMESET>

</HEAD>

<BODY>

</BODY> </HTML>

Save this code as a completed .html file.

This will open a new window displaying one html document in each frame.

The code above is a complete script. You don't need to anything between the <BODY> tags. Although here's a good tip, pre version 4 browsers can not render the frames tags, so for these browsers the contents of the body tag will be displayed. This is where I usually place a link to a free browser upgrade and a friendly note telling the user we are now in the 3rd millenium and that lasts millenniums browsers are not capable of 'viewing the content on this page'.

The file is telling the browser to split its window in to two frames and which documents to place in inside those frames.

The code in red

OK. First tag first. Open up a <FRAMESET> tag and use either the attribute rows="" for creating rows, or cols="" for creating columns. The attributes values ( separated with commas ) can be in the form of pixels for each frame as in  cols="400,300" or percentage as in  cols="50%,50%" or use the '*' for a variable value as in  cols="100,*". You can add as many rows or columns as you like just use the <Frame> tag to define each frames information in order. Refer to the table 2 for its attributes. The frame tag is closed with </FRAME> and then the frame set is closed with </FRAMESET>

Note: Although Netscape 4 tries to understand pixel values in the frame tag, it is really putting your specified value through a complex calculation that rounds down the value through each step of the formula, thus returning a close, but inexact value. That is why you can never quite position frames precisely in Netscape. A well known, but undocumented bug.

Table 1     A FRAMESET's attributes
attribute used for
cols="33,10%,*" setting the number of columns (each separated with a comma )
rows="20,20,20,20" setting the number of rows
border="2" setting the frames border for Internet Explorer in pixels
frameborder="2" setting the frames border for Netscape in pixels
framespacing="2" setting the frames spacing for Netscape in pixels

Table 2     A FRAME's attributes
attribute value used for
frameborder="" 0 or 1 0 or No to hide, 1 or Yes to show a border between frames
framespacing="2" 0 - 100 setting the frames spacing for Netscape in pixels
marginwidth="" 0 - 100 If set to 0 the frame will be displayed flush with the left and right edge of the frame
marginheight="" 0 - 100 If set to 10 , there will be a space (10 pixels wide) between the window and the top of the frame
name="" any name Assigning a name to your frames so you can use them as targets with the <A> tag
noresize none Disallowing the user to resize the frame.
scrolling="" auto-on-off Turning the scrollbars on the right side of each frame on or off.
src="" filename.html Sets the file name and its location on your hard drive,(or the servers hard drive) to be displayed in the frame. Remember servers use unix which make file names case sensitive.

Multiple frames

Creating many frames gets a little more complicated. Lets say you want 2 columns, each having 2 rows. You would open a frameset tag and assign it the attribute    cols="30%,70%". Then you open another frameset tag with the attribute   rows="50%,50%". Then you use the frame tag twice to name the files that will be displayed in each row in the 1st column. Now you close the second frameset you opened. Open a third frameset tag with the attribute    rows="20%,80%", use 2 frame tags to name the files to be displayed in the 2nd column. Close this frameset and finally close the 1st frameset. Here 's the code and its example if you dare to press the button.

<FRAMESET cols="30%,70%">

<FRAMESET rows="50%,50%" > <FRAME frameborder="1" name="frame1" src="frame1.html"> </FRAME> <FRAME frameborder="1" name="frame2" src="frame2.html"> </FRAME> </FRAMESET>

<FRAMESET rows="20%,80%"> <FRAME frameborder="1" name="frame3" src="frame3.html"> </FRAME> <FRAME frameborder="1" name="frame4" src="frame4.html"> </FRAME> </FRAMESET>

</FRAMESET>



Contents Intro Your first page Text Images Links Lists Tables
Frames Forms Sounds Styles Symbols Colors Tags Publish Index

Speed Search our site
Linux Hosting Plans from $9.12 per month, includes Plesk Control Panel, MySQL databases, cgi-bin, crontab manager and 50 email accounts.

Website Monitoring with SMS TXT alerts

Discounted Scripts
Subscribe to our periodial newsletter to receive special offers.

Bathroom Hygiene
How often do you thoroughly clean your bathroom?








View all Polls

Run Polls just like this one on your website!


About us | Contact us | Script FAQs | Script Support | Website Hosting | Our Policies | Store | Testimonials
Subscribers log in here. Subscribe to our periodical newsletter for special offers on commercial scripts, hosting, exciting business opportunities, and industry news and events. Our Mailing List Software is powered by Consolidator    
HTML Plain text
©1999 - 2015 All content Copyright PerlScriptsJavaScripts.com Proudly hosted by LinuxHostingPlans.com