2.0.0 • Published 8 years ago

lagden-tooltip v2.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

Tooltip

Build Status Dependency Status devDependency Status

A simple tooltip

Install

AMD and ES6 via NPM

npm i -S lagden-tooltip

Only AMD via bower

bower install -S lagden-tooltip

API

Methods

There are three methods: show, hide and destroy.

Options

Some options can be passed when initialize:

OptionDescriptionDefault
attrSpecify from whence come the value'data-lagden-tip'
contentCustom valuefalse
htmlEscaping your valuefalse
cssThe component stylesheet class name'theTooltip'
placeForce the place where shown the tooltip. Possibles values: auto, top and bottom'auto'
spaceAdd some space between target and tooltip15
fixedAvoid position error if the target is fixed or is within a fixed elementfalse

Usage

There are two ways:

Vanilla

var t = document.querySelector('#el');
var tooltip = new Tooltip(t, {content: 'Example!'});

jQuery

var $t = $('#el');
$t.theTooltip({
  content: '<h3>Title</h3><p>Some pretty cool stuff!</p>',
  html: true
});

Stylesheet

Take a look on stylus/tooltip.styl file.

Example

See here. Example

License

MIT © Thiago Lagden

2.0.0

8 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago