Oh shit we have tooltis too. This dipshit can be toglled wether on click with [data-toggle-tooltip-click] or hover with [data-toggle-tooltip-hover]
NOTE: The toggler for the tooltip mus not be a position:fixed; or a descendant of an element with that property unless you want your tooltip to dIE... or position itself like shit
Example tooltip that toggles on click
<a
href="#"
class="btn btn-primary"
data-toggle-tooltip-click
data-tooltip-placement="top"
data-tooltip-content="<strong>YEET</strong>"
>
Bitch boi on the top
</a>A bitch boy toggled on hover
<a
href="#"
class="btn btn-primary"
data-toggle-tooltip-hover
data-tooltip-placement="top"
data-tooltip-content="<strong>YEET</strong>"
>
Bitch boi on the top
</a>[data-toggle-tooltip-click] or [data-toggle-tooltip-hover] depending on how the fuck you want it to appear. This shit makes it happen. Add this to the element you need to hava a tooltip on
<span data-toggle-tooltip-hover></span>This makes a tooltip, but there's nothing in it yet because you need...
defaults to left
It places the boi somewhere you want
Other Available parameters: top,bottom,right,
defaults to false
Whether or not you want the tooltip's pointy boi have a badge element on it
defaults to 'primary'
This sets a color on the badge boi
Only useful if data-tooltip-badge is true. It accepts valid color tags values or valid background-color value
defaults to ''
How big do you want the boi?
Other Available parameters: small,large
Idk this is how you add classes or helper classes to the tooltip content but you have to be careful because some css may not work on the tooltip
defaults to ''
This is the content for the tooltip
By default tooltips attaches the tip by the edge, enable this to center the tooltips tail or badge if enabled horizontally. NOTE: will not work if data-tooltip-x is set
By default tooltips attaches the tip by the edge, enable this to center the tooltips tail or badge if enabled vertically. NOTE: will not work if data-tooltip-y is set
use inverse theme
duh. leave blank or large or small
Custom x offset. has to be a number,
NOTE: the tooltip is appended to the body so position ofset will be calculated based on the body
Custom y offset. has to be a number,
NOTE: the tooltip is appended to the body so position ofset will be calculated based on the body
duh
defaults to false. tooltips are disabled for pointer interactions so it doesn't get in the way of the clickiness of elements in the page. set to tru so you can interact with things in it
This is the markup our framework generates in case you need to make your own.
<!-- Wrapper and color overlay... adding .active shows the boi.. tooltip-[position] styles the tooltip tail's position -->
<div class="tooltip tooltip-top active">
<div class="tooltip-content">
<!-- content here -->
</div>
</div>you can try but be careful
Make a new boi by going const tooltip = new fw.Tooltip(triggerElement,args)
triggerElement is the tooltip triggerer. if blank, does nothing
args is the settings above available
//defaults
{
placement: 'left', //data-tooltip-placement
badge: false, //data-tooltip-badge
badgeBg: 'primary', //data-tooltip-badge-background
badgeSize: '', //
classes: '', //data-tooltip-classes
inverse:false, //data-tooltip-inverse
size: '', //data-tooltip-size
content: '<em class="color-neutral tooltip-placeholder">No info...</em>', //data-tooltip-content
centerX: false, //data-tooltip-center-x
centerY: false, //data-tooltip-center-y
x: false, //data-tooltip-x
y: false, //data-tooltip-y
width: null, //data-tooltip-width
allowInteraction: false //data-tooltip-allow-interaction
}duh
element is the element that triggers the tooltip
destroys currently active tooltip
positions ya boi based on whatever you put there. defaults to offsetting from the triggerter if coordinates are empty
gets {x,y} offset for tooltip based on triggerElement's position
click_fw_tooltip- happens ondata-toggle-tooltip-clickmouseenter_fw_tooltip- happens ondata-toggle-tooltip-hovermouseleave_fw_tooltip- happens ondata-toggle-tooltip-hoverclick_fw_tooltip_purge- happens on elements that qualify closing tooltip-click componentsbefore_create_fw_tooltip- happens onelementbefore createcreate_fw_tooltip- happens onelementwhen createafter_create_fw_tooltip- happens onelementafter createbefore_destroy_fw_tooltip- happens onelementbefore destroydestroy_fw_tooltip- happens onelementwhen destroyafter_destroy_fw_tooltip- happens onelementafter destroybefore_position_fw_tooltip- happens onelementbefore positionposition_fw_tooltip- happens onelementwhen positionafter_position_fw_tooltip- happens onelementafter position

