#
# required
#
# Put infobox.js and infobox.css in the same folder.
# Include class_infobox.php in your webpage.
#
include 'class_infobox.php';
#
# required
#
# then instantiate a class object
#
$box = new infobox();
#
# required
#
# in the head section of the html page
# call $box->head() giving the relative path from
# the php page to the folder where both
# infobox.js and infobox.css reside
#
$box->head('includes/'); // only valid if you put infobox.js into "includes"
#
# optional
#
# now generate the page as usual.
# when an infobox link is to be output
# then write
#
$box->link( $url, $urltext, $infoboxcaption, $infoboxcontent );
#
# ...providing $url, $urltext, $infoboxcaption and $infoboxcontent
# with useful content before doing so, I hope.
#
#
# optional
#
# The users of your page get quickly used to this kind of additional information.
# So many other clickable areas like buttons, images, checkboxes
# want to be supported with infobox.
# To get the correct mouse events you do the following
#
$mouse = $box->newtip('A new tip',"This is the content of the tip");
#
# optional
#
# now put $mouse which contains
# something like "onMouseOver="tip('infobox23')" onMouseOut="untip()"
# into the output, maybe an img tag
#
echo "<img$mouse src='beautifulimage.gif' alt=''>";
#
# optional
#
# using the function $box->lasttip() you can have your script
# remember the last infobox number generated and use it in
# multiple places using $box->thistip( $number )
#
#
# required
#
# at the end of the page, just before the closing body tag
#
$box->generate();
#
# $box->generate() will generate all tips
#
#
# *** IMPORTANT NOTICE ***
#
# *Never* use single quotes in the strings used for caption or description
# of the infoboxes! They will mess up the javascript code generated by
# $box->generate() resulting in no box working at all.
#
|