A simple and smart tip component using align
npm i auto-tip
<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 out
Initialize tip element and optional option.
option.limit
the minimal margin betwwen el and viewport in pixeles
Show with optional text and offset for align.
Remove the tip.
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);
}
Check if tip element visible.
MIT