npm

tooltipr

0.1.3 • Public • Published

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

Dependents (0)

Package Sidebar

Install

npm i tooltipr

Weekly Downloads

0

Version

0.1.3

License

MIT

Last publish

Collaborators

  • boyarskiy