|
Tooltip API
Loading the Tooltip API Step 1: Load the API. Place the following code in your page's HEAD tag. The src= value is the relative location of the .js file on your web server. <script type="text/javascript" src="tooltip.1.0.2.js"></script>
Tooltip Examples Mouse over the following. Tooltip text - You can put tooltips over text to interactively offer your visitors more information. <span onmouseover="tt_in('This is really cool. You should download this API.');"
onmouseout="tt_out();" style="cursor: help;">Tooltip text</span>Tooltip link - Let the visitor know more information about where they are going. <a href="http://www.bsgonlinegames.com/"
onmouseover="tt_in('BSG Online Games - Company Website');"
onmouseout="tt_out();">Tooltip link</a>An example HTML document <html>
<head>
<title>Example Tooltip Document</title>
<script type="text/javascript" src="tooltip.1.0.2.js"></script>
</head>
<body>
Mouse over the following.<br /><br />
<span onmouseover="tt_in('This is really cool. You should download this API.');"
onmouseout="tt_out();" style="cursor: help;">Tooltip text</span>
- You can put tooltips over text to
interactively offer your visitors more information.
<br />
</body>
</html>
PHP Tooltip Class
Using the Tooltip Class Step 1: Load the Tooltip JavaScript API Instructions are located at the top of this document. Step 2: Load the class. require_once("tooltip.class.php");
$tooltip = new bsg_ToolTip();Step 3: Call the class object $tooltip->add or $tooltip->addLink. // Example 1: Text Tooltip
echo $tooltip->add("This is a tooltip in a span.",
"This is the help information that you might want to provide on your website.
<br /><br />You can put any HTML in here.");
echo "<br /><br />\n";
// Example 2: Link Tooltip
echo $tooltip->addLink("This is a tooltip in a link", "http://www.bsgonlinegames.com/",
"This it the help tooltip text!");For a complete example view php-example.php. |
Network
Products & Services
|