GithubHelp home page GithubHelp logo

popper's Introduction

Popper Plugin

A javascript plugin for popper which could be used to positioning tooltip or popover

Install

npm install --save popper-plugin

Import file

<script src="node_modules/popper-plugin/dist/popper.min.js"></script>

Initialize plugin

const samplePopper = new PopperComponent({
  /** Refer below for available properties */
});

Properties

Name Type Default value Description
$popperEle Element Popper element
$triggerEle Element Trigger element
$arrowEle Element Arrow icon in the popper
position Number auto Position of popper (top, bottom, left, right, auto)
margin Number 8 Space between popper and its activator (in pixel)
offset Number 5 Space between popper and window edge (in pixel)
enterDelay Number 0 Delay time before showing popper (in milliseconds)
exitDelay Number 0 Delay time before hiding popper (in milliseconds)
showDuration Number 300 Transition duration for show animation (in milliseconds)
hideDuration Number 200 Transition duration for hide animation (in milliseconds)
transitionDistance Number 10 Distance to translate on show/hide animation (in pixel)
zIndex Number 1 CSS z-index value for popper
afterShow Function Callback function to trigger after show
afterHide Function Callback function to trigger after hide

Methods

show()

/**
 * @prop {boolean} [resetPosition] - Recalculate position before show
 * @prop {object} [data] - Any custom data which would be passed to afterShow callback function call
 */
samplePopper.show({});

hide()

/**
 * @prop {object} [data] - Any custom data which would be passed to afterHide callback function call
 */
samplePopper.hide({});

updatePosition()

To recalculate the position of the popper element. Which colud be used when scrolling the parent element.

samplePopper.updatePosition();

popper's People

Contributors

sa-si-dev avatar gnbm avatar

Stargazers

Trung Phụng  avatar Onofre Souza avatar Daniela Rus Morales avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.