|
||
| Inside Technique : Cool Rules : Creating a Rule No matter if you are generating the rule on the client or server you add it to the page in the same manner. You include the small script that generates the rule and then insert another script
at the location you want the rule. Where you want the rule, the script calls the createHR() function and outputs the generated HTML into the document.
To create a rule on the client like the one on the first page, you call the createHR() function as follows:
The createHR() function returns an HTML table that represents the rule. If you are reusing the same rule
multiple times in your document, you should cache the return value in a variable and write the variable into
the document. This will improve performance as the table only needs to be calculated once. For example:
The createHR() function has 5 required arguments representing the start and end colors, the number of steps, and the size. In addition
there are three optional arguments for creating a cross browser rule, the rule's direction, and the rule's
alignment. Below is the complete prototype and description of arguments for the createHR() function:
We created a very simple page that demonstrates the variety of rules that can be created with the createHR() function. Page 1:Cool Rules © 1997-2000 InsideDHTML.com, LLC. All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||