JHTML::_('behavior.tooltip') — Set tooltip position

by Charles Wilkins IV   Last Updated September 30, 2019 19:10 PM - source

I'm trying to set the position of the tooltip in Joomla 3.9.8.

I've used:

JHTML::_('behavior.tooltip');

At the top of the document. I then have field set as:

<?php
echo JHTML::tooltip($standings[$k][$k3][$k4]['team_name'], '', 
            '', $standings[$k][$k3][$k4]['team_abbr']);
?>

This works fine. It displays the team abbr and when I mouseover it, it displays the team name.

The only problem is that it displays it way too low before the field. It appears, based on Google DevTools that it automatically calculates a fixed position. This position needs to be 47 pixels right and 40 pixels higher.

I tried using the offset parameter code in the Joomla Docs to no avail:

// set x (horizontal) distance to 20 pixels, y (vertical) distance to 30 pixels

$toolTipArray = array('offsets'=>array('x'=>-47, 'y'=>40), 
'maxtitlechars'=>40);
JHTML::_('behavior.tooltip', '.customOffset', $toolTipArray);


Related Questions


A PHP 7 question concerning =&

Updated June 08, 2017 15:10 PM

different templates based on $item number

Updated February 17, 2018 15:10 PM


Upgrade PHP to 7.2 cause error

Updated October 28, 2018 14:10 PM