FlexTip Documentation
Markup
Typically a FlexTip is created by adding the "flextip" class to a div and you use data-attributes to configure that particular FlexTip.
<div class="flextip"
data-target-id="myFlexTip"
data-target-annotationStyle="none"
data-target-iconColor="#ccc"
data-trigger="hover"
data-auto-close="true"
data-position="top"
data-align="center"
data-styles-css-class=""
data-styles-padding="5px 10px"
data-styles-background-color="#f6f6f6"
data-styles-border-radius="4px"
data-styles-transition="opacity 0.5s"
data-styles-boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)"
data-gap="20"
data-arrow-use="true"
data-arrow-size="5px"
data-padding="10px"
data-zindex="1000"
>
Some Content
</div>
Default configuration
Use FlexTip.configure(<options object>) to set default configuration for all FlexTips on a page.
FlexTip.configure({
trigger: "hover",
autoClose: true,
position: "top",
align: "center",
gap: "5px",
zIndex: 1000,
target: {
annotationStyle: "none",
iconColor: "#ccc"
},
arrow: {
use: true,
size: "5px"
},
styles: {
cssClass: "",
padding: "5px 10px",
backgroundColor: "#f6f6f6",
borderRadius: "4px",
transition: "opacity 0.5s",
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)"
},
scrim: {
opacity: 0,
backgroundColor: "transparent"
}
});
Data- attributes
Description of all possible data- attributes used to configure an individual FlexTip.
| Attribute | Values | Description |
|---|---|---|
| class | flextip |
|
| id | html id |
|
| data-trigger | click | hover |
|
| data-auto-close | true | false |
|
| data-position | top | right | bottom | left |
|
| data-align | start | center | end |
|
| data-gap | ||
| data-z-index | number |
|
| target | ||
| data-target-id | html id |
|
| data-target-annotation-style | superscript | underline | bracket | none |
|
| data-target-icon-color | html color |
|
| arrow | ||
| data-arrow-use | true | false |
|
| data-arrow-size |
|
|
| styles | ||
| data-styles-background-color | html color | none |
|
| data-styles-css-class | ||
| data-styles-padding | ||
| data-styles-border-radius | ||
| data-styles-transition | ||
| data-styles-box-shadow |
API
| FlexTip.create() | ||
| myFlexTip.update(options, content) | ||
| myFlexTip.updateContent(content) |