tooltipr
v0.1.3
Published
Simplest JavaScript Tooltip
Downloads
6
Readme
Tooltipr
Simplest JavaScript tooltips
Instal
$ npm install --save tooltipr
Usage
Require tooltip after installation
var tooltipr = require("tooltipr");
Add data-tooltip = "hello world"
to your element
<div class="elem" data-tooltip="hello world">Tooltip</div>
Create tooltip
var tooltip = tooltipr();
var elem = document.querySelector('.elem');
elem.onmouseover = function() {
tooltip.create();
}
Remove tooltip
elem.onmouseout = function() {
tooltip.remove();
}
Add styles
.tooltip {
position: fixed;
}
License
MIT