english/libraries/joomla/html/html/behavior.php
/**
	 * Add unobtrusive javascript support for a hover tooltips.
	 *
	 * Add a title attribute to any element in the form
	 * title="title::text"
	 *
	 * Options for the tooltip can be:
	 * - maxTitleChars	int		The maximum number of characters in the tooltip title (defaults to 50).
	 * - offsets		object	The distance of your tooltip from the mouse (defaults to {'x': 16, 'y': 16}).
	 * - showDelay		int		The millisecond delay the show event is fired (defaults to 100).
	 * - hideDelay		int		The millisecond delay the hide hide is fired (defaults to 100).
	 * - className		string	The className your tooltip container will get.
	 * - fixed			boolean	If set to true, the toolTip will not follow the mouse.
	 * - onShow			func	The default function for the show event, passes the tip element and the currently hovered element.
	 * - onHide			func	The default function for the hide event, passes the currently hovered element.
	 *
	 * Uses the core Tips class in MooTools.
	 *
	 * @param   string   $selector	The class selector for the tooltip.
	 * @param   array    $params		An array of options for the tooltip.
	 *
	 * @return  void
	 * @since   11.1
	 */
Add unobtrusive javascript support for a hover tooltips.
Add a title attribute to any element in the form
title="title::text"

Options for the tooltip can be:
- maxTitleChars      int             The maximum number of characters in the tooltip title (defaults to 50).
- offsets            object  The distance of your tooltip from the mouse (defaults to {'x': 16, 'y': 16}).
- showDelay          int             The millisecond delay the show event is fired (defaults to 100).
- hideDelay          int             The millisecond delay the hide hide is fired (defaults to 100).
- className          string  The className your tooltip container will get.
- fixed                      boolean If set to true, the toolTip will not follow the mouse.
- onShow                     func    The default function for the show event, passes the tip element and the currently hovered element.
- onHide                     func    The default function for the hide event, passes the currently hovered element.

Uses the core Tips class in MooTools.

@param   string   $selector  The class selector for the tooltip.
@param   array    $params            An array of options for the tooltip.


Add unobtrusive javascript support for a hover tooltips . Add a title attribute to any element in the form title = " title :: text " Options for the tooltip can be : - maxTitleChars int The maximum number of characters in the tooltip title ( defaults to 50 ) . - offsets object The distance of your tooltip from the mouse ( defaults to { ' x ' : 16 ' y ' : 16 } ) . - showDelay int The millisecond delay the show event is fired ( defaults to 100 ) . - hideDelay int The millisecond delay the hide hide is fired ( defaults to 100 ) . - className string The className your tooltip container will get . - fixed boolean If set to true the toolTip will not follow the mouse . - onShow func The default function for the show event passes the tip element and the currently hovered element . - onHide func The default function for the hide event passes the currently hovered element . Uses the core Tips class in MooTools . @param string $selector The class selector for the tooltip . @param array $params An array of options for the tooltip .
public static function tooltip($selector='.hasTip', $params = array())
	{
		static $tips;
		if (!isset($tips)) {
			$tips = array();
		}
		self::framework(true);
		$sig = md5(serialize(array($selector,$params)));
		if (isset($tips[$sig]) && ($tips[$sig])) {
			return;
		}
		$opt['maxTitleChars']	= (isset($params['maxTitleChars']) && ($params['maxTitleChars'])) ? (int)$params['maxTitleChars'] : 50 ;
		$opt['offset']			= (isset($params['offset']) && (is_array($params['offset']))) ? $params['offset'] : null;
		if (!isset($opt['offset'])) {
			$opt['offset']		= (isset($params['offsets']) && (is_array($params['offsets']))) ? $params['offsets'] : null;
		}
		$opt['showDelay']		= (isset($params['showDelay'])) ? (int)$params['showDelay'] : null;
		$opt['hideDelay']		= (isset($params['hideDelay'])) ? (int)$params['hideDelay'] : null;
		$opt['className']		= (isset($params['className'])) ? $params['className'] : null;
		$opt['fixed']			= (isset($params['fixed']) && ($params['fixed'])) ? '\\true' : '\\false';
		$opt['onShow']			= (isset($params['onShow'])) ? '\\'.$params['onShow'] : null;
		$opt['onHide']			= (isset($params['onHide'])) ? '\\'.$params['onHide'] : null;
		$options = JHtmlBehavior::_getJSObject($opt);
		$document = JFactory::getDocument();
		$document->addScriptDeclaration("
		window.addEvent('domready', function() {
			$$('$selector').each(function(el) {
				var title = el.get('title');
				if (title) {
					var parts = title.split('::', 2);
					el.store('tip:title', parts[0]);
					el.store('tip:text', parts[1]);
				}
			});
			var JTooltips = new Tips($$('$selector'), $options);
		});");
		$tips[$sig] = true;
		return;
	}
public static function tooltip ( $ selector = '.hasTip' , $ params = array ( ) ) { static $ tips ; if ( ! isset ( $ tips ) ) { $ tips = array ( ) ; } self :: framework ( true ) ; $ sig = md5 ( serialize ( array ( $ selector , $ params ) ) ) ; if ( isset ( $ tips [ $ sig ] ) && ( $ tips [ $ sig ] ) ) { return ; } $ opt [ 'maxTitleChars' ] = ( isset ( $ params [ 'maxTitleChars' ] ) && ( $ params [ 'maxTitleChars' ] ) ) ? ( int ) $ params [ 'maxTitleChars' ] : 50 ; $ opt [ 'offset' ] = ( isset ( $ params [ 'offset' ] ) && ( is_array ( $ params [ 'offset' ] ) ) ) ? $ params [ 'offset' ] : null ; if ( ! isset ( $ opt [ 'offset' ] ) ) { $ opt [ 'offset' ] = ( isset ( $ params [ 'offsets' ] ) && ( is_array ( $ params [ 'offsets' ] ) ) ) ? $ params [ 'offsets' ] : null ; } $ opt [ 'showDelay' ] = ( isset ( $ params [ 'showDelay' ] ) ) ? ( int ) $ params [ 'showDelay' ] : null ; $ opt [ 'hideDelay' ] = ( isset ( $ params [ 'hideDelay' ] ) ) ? ( int ) $ params [ 'hideDelay' ] : null ; $ opt [ 'className' ] = ( isset ( $ params [ 'className' ] ) ) ? $ params [ 'className' ] : null ; $ opt [ 'fixed' ] = ( isset ( $ params [ 'fixed' ] ) && ( $ params [ 'fixed' ] ) ) ? '\\true' : '\\false' ; $ opt [ 'onShow' ] = ( isset ( $ params [ 'onShow' ] ) ) ? '\\' . $ params [ 'onShow' ] : null ; $ opt [ 'onHide' ] = ( isset ( $ params [ 'onHide' ] ) ) ? '\\' . $ params [ 'onHide' ] : null ; $ options = JHtmlBehavior :: _getJSObject ( $ opt ) ; $ document = JFactory :: getDocument ( ) ; $ document -> addScriptDeclaration ( " 
		window.addEvent('domready', function() {
			$$(' $ selector ').each(function(el) {
				var title = el.get('title');
				if (title) {
					var parts = title.split('::', 2);
					el.store('tip:title', parts[0]);
					el.store('tip:text', parts[1]);
				}
			});
			var JTooltips = new Tips($$(' $ selector '),  $ options );
		}); " ) ; $ tips [ $ sig ] = true ; return ; }
Add unobtrusive javascript support for a hover tooltips.
Add unobtrusive javascript support for a hover tooltips .
// Include MooTools framework // Setup options object // offsets needs an array in the format: array('x'=>20, 'y'=>30) // Suppporting offsets parameter which was working in mootools 1.2 (Joomla!1.5) // Attach tooltips to document // Set static array