XF 2.0 How to use Tooltips Core for custom tooltips

uf4b

New member
Hello,
I wanted to know how to use the included core js functions to handle tooltips.
I found there is a tooltip.js file , and there are different options to choose from.. Preview , Basic , Element etc..

I need to display custom html not just an inline text.
For simple inline texts adding data-xf-init="tooltip" and a title="" attribute on my element, it works..
But how can I display a content from a unique div for example ?

Thanks in advance..
 
Sorry for duplicate post but I think write it separately is better.

XF has custom tooltip functions, one for basic tooltip that displays only text and another for tooltip with html content called ElementTooltip.

Basic tooltip needs data-xf-init="tooltip" and title attribute.

For ElementTooltip, you need to specify data-xf-init="element-tooltip" and an attribute xf-element="css-selector-to-the-html-content". You have to create an element that contains the tooltip html. Look at the attachment.
 

Attachments

  • Screenshot at 19-03-23 13:52:53.webp
    Screenshot at 19-03-23 13:52:53.webp
    9.2 KB · Views: 170
Back
Top Bottom