auto-tip
v0.0.2
Published
simple and smart tip component
Downloads
24
Readme
Auto-tip
A simple and smart tip component using align
Install
npm i auto-tipExample
<span data-tip="add new item" data-tip-position="tc-bc">+</span>var Tip = require('auto-tip')
var tip = Tip(el)
tip.show()
tip.hide() // tip.fade() to fade outAPI
tip(el, [option])
Initialize tip element and optional option.
option.limitthe minimal margin betwwen el and viewport in pixeles
.show([text], [offset])
Show with optional text and offset for align.
.hide()
Remove the tip.
.fade()
Remove the tip with fade css classes, change classes .tip-hide to customized
it, default is:
.tip-hide {
opacity: 0;
-webkit-transform: translateY(-5px);
-ms-transform: translateY(-5px);
transform: translateY(-5px);
}.visible
Check if tip element visible.
License
MIT
