Poppingjs (not publish yet)

is a tooltip & popover positioning engine which is delightfully made in pure vanila javascript without dependency what so ever.

Installation(not publish yet) #

npm i poppingjs
Imports #

import Popping from "poppingjs"
import { PoppingFlip } from "poppingjs/modifiers"
import { PoppingScroll, PoppingResize } from "poppingjs/plugins"
Getting Started #

we are getting started using poppingjs.

<div class="popping-container" id="getting-started">
<img
class="popping-center"
src="/images/icons/icon-96x96.png"
alt="beard-guy"
width="96"
height="96"/>
<div class="popping n-bg">
mytabworks
</div>
</div>
beard-guy
top

when one of the parent or ancestor element has position: relative; that will be the base of the tooltip positioning or else it will be the html element itself.

Create Plugin #

you can create your own plugin.

<div class="popping-container n-flat" id="pop-create-plugin">
<img
class="popping-center"
src="/images/icons/icon-96x96.png"
alt="beard-guy"
width="96"
height="96"
draggable={false}/>
<div class="popping n-bg-intense">
Drag me
</div>
</div>
beard-guy
Drag me
Flipping #

to enable flipping you must apply PoppingFlip to the modifiers

<div class="popping-container n-flat" id="pop-flipping">
<img
class="popping-center"
src="/images/icons/icon-96x96.png"
alt="beard-guy"
width="96"
height="96"
draggable={false}/>
<div class="popping n-bg-intense">
Drag me to edges
</div>
</div>
beard-guy
Drag me to edges
Persistent #

by applying PoppingScroll(to update the dialog on every scroll) into the plugins and setting the option allowPersistent into true

<div class="popping-container popping-scroll n-flat" id="pop-persistent">
<div style="height: 1000px; width: 1000px"/>
<div class="text-center">
<img width="96" height="96" src="/images/icons/icon-96x96.png" alt="beard-guy"/>
</div>
<div class="popping n-bg-intense">
Scroll me
</div>
<div style="height: 1000px"/>
</div>
beard-guy
Scroll me
Animated #

animating to popping when hovering or clicking.

<div class="popping-container n-flat" id="pop-animated" data-example>
<img
className="popping-center"
src="/images/icons/icon-96x96.png"
alt="beard-guy"
width="96"
height="96"/>
<div class="popping popping-animated n-bg-intense">
you can see me
</div>
</div>
beard-guy
you can see me

API

Popping #

Argument
Argument
Type
Type
Default
Default
Description
Description
Popping.create(
targetelement | node-the element you want to place your dialog.
dialogelement | node-it is the element of tooltip dialog suppose to be pops next to the target.
)
Popping Methods #

Method
Method
Return
Return
Default
Default
Description
Description
Instance.updatePositionvoid-it is use to update the position of the tooltip dialog.
Instance.destroyvoid-it is use to destroy and kill the eventListeners.
Warning!

In this pre-deployed stage, most of the library you will witness has yet been publish or update in npm.