Memberscripts by Memberstack

#110 - Tooltips for Webflow

An easy, attributes-based solution for adding tooltips to your Webflow site in seconds - powered by everyone's favorite tooltip library, Tippy.js!

Placement

All tooltips MUST have a placement attribute.

ms-code-tooltip-right = This is some helper text
ms-code-tooltip-left = This is some helper text
ms-code-tooltip-top = This is some helper text
ms-code-tooltip-bottom = This is some helper text
ms-code-tooltip-placement = top-start
ms-code-tooltip-content = This is some helper text

Includes more options for placement. Possible options are "top", "top-start", "top-end", "right", "right-start", "right-end", "bottom", "bottom-start", "bottom-end", "left", "left-start", "left-end", "auto", "auto-start", and "auto-end".

Animation

Allows you to override the default animation style of your tooltips.

ms-code-tooltip-animation = fade
ms-code-tooltip-animation = shift-away
ms-code-tooltip-animation = shift-toward
ms-code-tooltip-animation = perspective

Theme

Allows you to override the default theme set in your code.

ms-code-tooltip-theme = dark
ms-code-tooltip-theme = light

Max Width

Allows you to set a max width to the tooltip. Usually important if your tooltip has a lot of text. Accepts any positive number in pixels.

ms-code-tooltip-maxwidth = 200

Delay

Use one number to set the delay for both appearing and disappearing, or use 2 numbers in an array to specify the delay for each. Numbers are in milliseconds.

ms-code-tooltip-delay = 500
ms-code-tooltip-delay = [0,500]
ms-code-tooltip-delay = [500,0]

Duration

Allows you to set the duration of time the animation runs for. Enter in one number to set both the in and out times, and use 2 numbers in an array to set each independently. Numbers are in milliseconds.

ms-code-tooltip-duration = 500
ms-code-tooltip-duration = [0,500]
ms-code-tooltip-duration = [500,0]

Interactive

Determines whether or not you can hover over & interact with the tooltip. Boolean values (true/false) are accepted.

ms-code-tooltip-interactive = true
ms-code-tooltip-interactive = false

Arrow

Determines whether or not the tooltip arrow will be visible. Boolean values (true/false) are accepted.

ms-code-tooltip-arrow = true
ms-code-tooltip-arrow = false

Trigger

Allows you to override the default trigger for the tooltip. Accepts any of the following values, or a space-separated list of any of them.

ms-code-tooltip-trigger = mouseenter
ms-code-tooltip-trigger = click
ms-code-tooltip-trigger = focus

Most commonly used for form inputs.

Hide On Click

Allows you to set whether or not the tooltip will be hidden on click. Boolean values (true/false) are accepted.

ms-code-tooltip-hideonclick = true
ms-code-tooltip-hideonclick = false

Follow Cursor

Allows the tooltip to follow the users' cursor in different ways.

ms-code-tooltip-followcursor = true
ms-code-tooltip-followcursor = horizontal
ms-code-tooltip-followcursor = vertical
ms-code-tooltip-followcursor = initial

Offset

Allows you to set the X and Y offset for the tooltip. Accepts an array of two numbers [X, Y].

ms-code-tooltip-offset = [-100,100]
ms-code-tooltip-offset = [0,100]
ms-code-tooltip-offset = [100,0]

Z Index

Allows you to set the Z index of the tooltip.

ms-code-tooltip-zindex = 999

Allow HTML

Allows you to put HTML content inside of the tooltip. TIP: Build something inside of Webflow, and then inspect element to get the HTML.

ms-code-tooltip-allowhtml = true
ms-code-tooltip-allowhtml = false

Touch

Determines whether or not the tooltip will appear when touched on a mobile/ touchscreen device. Accepts boolean values  ("true", "false").

ms-code-tooltip-touch = true
ms-code-tooltip-touch = false