You can style the tooltips by custom code. In Webflow paste this code into the “before body” custom code section inside global settings of your site. Then modify the parameters in this code, for example background color, shadows etc. Don’t forget to style the tooltip tip as well - you need to change the border colors to achieve this. The below code will make your tooltips red.
Is it possible to pull the tooltip content in from a CMS field? We can’t grab that from the custom div attributes, wondering if there’s a workaround here. Thanks!
If i’m not mistaken, you can map a CMS field to any text box, right?
So it’s possible to workaround using additional jQuery code.
Have a hidden container that contains the tooltip text
Use jQuery to get the value of the container and append it to the closest element, that should trigger tooltip. For example, if you have a product box and small question mark inside the box that triggers the tooltip, it will roughly go like this
$('.product-box').each(function() {
var thisTooltipText = $(this).find('.tooltip-content').text();
$(this).find('.question-mark-tooltip-trigger').attr('title', thisTooltipText);
});
You need to place this code before initialising tooltipster (that means above the “tooltipster-for-webflow” custom script in Webflow custom code box). If that’s not possible, you can anyway reinit it by running tooltipster_init()
Hope that works, if not I’m sure we can figure this out.
This is a really helpful tool, @Maciej. Thanks for making it available!
Is there a way to change the offset of the tooltip? Currently I’m using it on a table at the bottom of this page, and it shows up centered on the row, while I’d like it to be over on the left where my “info” icons appear.
Offset is not going to help here, since you have a flexible layout. I think you need a different workaround. You need to attach the tooltip to the icon container, but trigger it appearing when hovering over the whole row. This will also work better on mobile since people may want to click the info icon to show the tooltip.
So you’ll need to do 2 things:
Instead of adding tooltipster=top and title attrubitues on the “table-row” element, add them on the info icon img
This worked perfectly and was easy to implement. I want to complement you again on this useful tool. Thanks! I hope to one day be expert enough with Webflow to be able to offer help to others this way.
I hope you’ll consider adding this option to your original tutorial, so others may use it too.
I am having trouble with your solution. Probably because I have never used attributes and am doing it wrong.
Could you send a screenshot of how you insert the code into the attribute area, please?
If I add tooltipster=“top” into the value, I have to add a name. Then it does not read tooltipster=“top”, as it does in your screenshot. It shows the title I add + tooltipster=“top”: