CLASS_LINKROW.PHP
=================
A simple implementation of drop-down buttons.
header1 | header2 | header3 | ....
| |
V V
item11 item21
item12
Mouse hover over header1 will drop down list of item11 and item12.
Each button, includer header and item, can be either a http link or just a comment.
The presentation of the button are based on CSS style and can be specified individualy.
To construct above lists:
$linkrow = new LINKROW(); // no parameter needed
// Add first column
$linkrow->AddColumn(); // start of first column
$linkrow->AddItem("header1", "", "header-no-link"); // header button (always display)
$linkrow->AddItem("item11", "http://item11", "linkstyle"); // first button with link
$linkrow->AddItem("item12", "", "commentstyle"); // second button is just a comment
// Add second column
$linkrow->AddColumn(); // start of first column
$linkrow->AddItem("header2", "http://header2", "header-with-link"); // header button (always display)
$linkrow->AddItem("item21", "http://item21", "linkstyle"); // first button with link
// Add third column
$linkrow->AddColumn(); // start of first column
$linkrow->AddItem("header3", "http://header3", "header-with-link"); // header button (always display)
// Add fourth column
$linkrow->AddColumn(); // start of first column
....
You need to create the corresponding style in the html page:
<style>
.header-no-link {....}
.header-with-link {....}
.linkstyle {....}
.commentstyle {....}
:hover { background:white; ...} // nice to have
</style>
Embeded in the place you want to display the list:
<?php $linkrow->GenDropTable(); ?>
Tested on IE 6 and Netscape 7.
FUNCTION
========
LINKROW() : instantiate the class
AddColumn() : Add a column marker
AddItem( "Description", "Link", "Style")
Description: Text appears on the screen
Link: If something is keyed in, it will be put into:
<A HREF="Link">DESCRIPTION</A>. If not, only Description will be printed
STYLE: the format will use class="Style" in the <DIV> tag.
GenDropTable() : return a string
|