Another effect used across the web is the tool tip. Tool tips are used to add messages that are displayed near the mouse pointer when you hover over specific elements on the screen. This is helpful for adding definitions of things without taking up space on the page. Adding a tool tip in Joomla! is even simpler than adding modal boxes you don't need to make a separate call to display the content. In the /components/com_js/js.php
file, add the following function to the controller:
function toolTipTest() { JHTML::_('behavior.tooltip'); ?> <span class="hasTip" title="Click here to go to the home page"><a href="index.php">Homepage</a></span> <?php }
As with the modal box, we call JHTML::_()
to pull in the MooTools framework. This time, behavior.tooltip
is passed as the parameter. After this, an anchor tag is output, to create a link. This anchor tag is wrapped in a<span>
that has two attributes class
and title
. The class attribute is set to hasTip...