Documentation Menu

1.5 Template Project

The Joomla! Documentation Working Group is running a project to develop detailed reference and tutorial material on Joomla! 1.5 templates.  There is a project page on the documentation wiki where you can see the work in progress and help us by contributing your knowledge.

Who's Online

We have 8 guests online

Help Site License

The Joomla! Help Site content is copyright © 2005 - 2008 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution NonCommercial ShareAlike 2.5. Some parts of this website may be subject to other licenses.
Home arrow Manual arrow 11. API Reference arrow mosToolTip

mosToolTip PDF Print E-mail

Last reviewed: 19 Nov 2005, Joomla 1.0.3
phpDocumentor

mosToolTip

Creates the HTML for a Tool Tip.

This is a utility function to provide Tool Tip functionality.

Returns the HTML code for the tool tip (an icon or text that displays a small window of text with an optional title when the mouse is moved over it). The first parameter must be supplied, otherwise the function will generate a warning. All other parameters have default values that are generally adequate.

The overlib_mini.js file must be included in the page output. This file is found in the includes/js directory.

Syntax

array mosToolTip ( string $tooltip [, string $title [, int $width [, string $image [, string $text [, string $href [, boolean $link ]]]]]] )

$tooltip
is the text to display in the tooltip.
$title
is the title to display at the top of the tooltip box. This parameter is optional and if omitted will default to ''.
$width
is the width of the tooltip. This should be only a number, in pixels. This parameter is optional and if omitted no width will be specified. The overlib library defaults to 200.
$image
is the filename for the image. This should be relative to the '/includes/js/ThemeOffice' folder. The image will only be displayed if the text parameter is not given or is empty. This parameter is optional and if omitted will default to 'tooltip.png'.
$text
is the text to display which triggers the tool tip. This parameter is optional and if omitted will default to ''. In this case, an image will be displayed instead of text, as specified in the $image parameter.
$href
is the url of the link location to be followed if the tooltip image or text is clicked. This parameter is optional and if omitted will default to '#'.
$link
is a boolean value specifying if the text or image should be a link. Specify a false value to have only a mouseover without a link. This is implemented with a <span> tag. This parameter is optional and if omitted will default to 1.

Defined in

libraries/joomla/functions.php
(includes/joomla.php prior to Joomla 1.1)
(includes/mambo.php prior to Joomla 1.0)

Examples

Example: A basic tool tip.

function basicToolTip() {
    global $mosConfig_live_site;
 
    echo "This is tool tip example one.";
    echo mosToolTip( "This is a basic tool tip" );
 
    echo "<script  type=\"text/javascript\" "
    . "src=\"$mosConfig_live_site/includes/js/overlib_mini.js\">"
    . "</script>";
}
 
basicToolTip();

might produce:

This is tool tip example one.
<a href="http://help.joomla.org/content/view/1562/60/#"
    onMouseOver="return overlib('This is a basic tool tip', BELOW, RIGHT);"
    onmouseout="return nd();" ><img 
    src="http://help.joomla.org/includes/js/ThemeOffice/tooltip.png"
    border="0" /></a>
<script type="text/javascript"
    src="http://help.joomla.org/includes/js/overlib_mini.js">
</script>
 

which renders as:

This is tool tip example one.

Example: A tool tip with a title.

function titledToolTip() {
    global $mosConfig_live_site;
 
    echo "This is tool tip example two.";
    echo mosToolTip( "This is a tool tip with a title", "Tool Tip Title" );
 
    echo "<script  type=\"text/javascript\" "
    . "src=\"$mosConfig_live_site/includes/js/overlib_mini.js\"></script>";
}
 
titledToolTip();

might produce:

This is tool tip example two.
<a href="http://help.joomla.org/content/view/1562/60/#" 
    onMouseOver="return overlib('This is a tool tip with a title', CAPTION,
        'Tool Tip Title', BELOW, RIGHT);"
    onmouseout="return nd();" ><img
    src="http://help.joomla.org/includes/js/ThemeOffice/tooltip.png"
    border="0" /></a>
<script type="text/javascript"
    src="http://help.joomla.org/includes/js/overlib_mini.js">
</script>

which renders as:

This is tool tip example two.

Example: A text tool tip with a title and a link to www.joomla.org.

function linkedToolTip() {
    global $mosConfig_live_site;
 
    echo "This is tool tip example three.";
    echo mosToolTip(
        "This is a text tool tip with a link", 
        "Tool Tip Title", 
        '', 
        'tooltip.png',
        "Download Joomla! Here!",
        "http://www.joomla.org", 1
        );
 
    echo "<script  type=\"text/javascript\""
    . " src=\"$mosConfig_live_site/includes/js/overlib_mini.js\">"
    . "</script>";
}
 
linkedToolTip();

might produce:

This is tool tip example three.
<a href="http://www.joomla.org"
    onMouseOver="return overlib('This is a text tool tip with a link to joomla.org',
        CAPTION, 'Tool Tip Title', BELOW, RIGHT);"
    onmouseout="return nd();" >Download Joomla! Here!</a>
<script type="text/javascript"
    src="http://127.0.0.1/stable/includes/js/overlib_mini.js">
</script>
 

which renders as:

This is tool tip example three.Download Joomla! Here!


Please report any errors on this page to the Developer Documentation Forum.

Last Updated ( Tuesday, 03 January 2006 )
 
< Prev