npm install tooltip``sh`
$ npm install tooltip --save
`js
var tooltip = require('tooltip')
tooltip()
`
`html`Test the tooltip
Now hover over h2 and the tooltip will show.
Or, with config:
`js
var tooltip = require('tooltip')
var config = {
showDelay: 100,
style: {
padding: 5
}
}
tooltip(config)
`
* target - defaults to document.documentElement. Tooltips will be displayed only for elements inside target."tooltip"
* style - styles to be applied to the tooltip element
* className - a css class to be applied to the tooltip element. Defaults to 500
* showDelay - defaults to msdocument.body.appendChild(tooltipElement)
* visibleStyle - style to be applied to the tooltip element when it is visible
* hiddenStyle - style to be applied to the tooltip element when it is hidden
* appendTooltip: Function - a function to append the tooltip (defaults to doing )"data-tooltip"
* offset - defaults to { x: 5, y: 5 }
* attrName - defaults to . Tooltip will show on hover over elements with this attribute.
Specify data-tooltip-positions="top;bottom;left;right"` to dictate the order of the positions preferred by the tooltip.
#### MIT