Giter Club home page Giter Club logo

popover's Introduction

๐Ÿ’ฌ popover

Create hover popups from HTML elements.

Include the library

<script src="/path/to/popover.js" type="text/javascript"></script>

Define a popover target

Add an element that will act as the popover target. The popover is positioned relative to this.

<div id="target-1">Hover me</div>

Define the popover contents

Add your popover contents to the document.

By default, the original popover contents do not have their visibility modified even when the popover is not visible. It is advised to use css to hide any content that is not to be seen until it has been rendered in a popover. This is shown in the example below.

<div id="contents" style="display: none;">
  <div id="content-1">
    This content will be shown in a popover
  </div>
</div>

Create the popover

Create a new instance of Popover with the target and contents elements as arguments.

const target = document.querySelector('#target-1');
const contents = document.querySelector('#content-1');

const popover = new Popover(target, contents);

popover's People

Contributors

brookesb91 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  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.