I will be adding short exercises here dealing with some JS techs and frameworks. The idea is to continually expand my knowledge while leaving behind useful code snippets for anyone that want to get started on the same techs.
- YATP: Yet Another Tooltip Plugin
Write a simple jQuery tooltip plugin. It should only be needed to invoque once, and it will automatically pickup the existing data-tootilp
and use that for display.
- Single invocation:
$.tooltip('.tooltipClass');
where .tooltipClass is the user-chosen class used for marking tooltip-able elements. - Text is given in the html via
data-tooltip
attributes. - Tooltips are shown above the element, with the text centered.