Tip component. Inspired by tipsy without the weird jQuery API.
Live demo is here.
$ npm install component-tip
- events for composition
- "auto" positioning on window resize / scroll
- fluent API
show
the tip is shownhide
the tip is hidden
Equivalent to Tip(el, { value: string })
.
Attach a Tip
to an element, and display the title
attribute's contents on hover. Optionally apply a hide delay
in milliseconds.
Also if static
is true the tip will be fixed to its initial position.
var tip = require('tip');
tip('a[title]', { delay: 300 });
Create a new tip with content
being
either a string, html, element, etc.
var Tip = require('tip');
var tip = new Tip('Hello!');
tip.show('#mylink');
top
top right
top left
bottom
bottom right
bottom left
right
left
Options:
auto
set to false to disable auto-positioning
Show the tip attached to el
, where el
may be a selector or element.
Show the tip at the absolute position (x, y)
.
Hide the tip immediately or wait ms
.
Attach the tip to the given el
, showing on mouseover
and hiding on mouseout
.
Use effect name
. Default with Tip.effect = 'fade'
for example.
MIT