Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

popup-simple

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

popup-simple

Small JS plugin to handle popup

  • 1.0.9
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

popup-js

Install

npm i popup-simple
<button class="btn js-popup-open" data-popup-target="popup-name">open popup</button>

<div class="popup js-popup" data-popup="popup-name">
  <div class="popup__inner">
    <button class="popup__close js-popup-close"></button>
      <!-- popup content -->    
  </div>
</div>

<!-- by anchor -->
<a href="#popup-name" class="btn js-popup-open">open popup</a>

<div id="popup-name" class="popup js-popup">
  <div class="popup__inner">
    <button class="popup__close js-popup-close"></button>
      <!-- popup content -->
  </div>
</div>
import Popup from 'popup-simple'

const popup = new Popup()
popup.init()

Options

Standart options

{
  toggleBodyClass: true, // toggle body overflow hidden class
  escapeHandler: true, // handle Esc button click
  closeOnOverlayClick: true, // close on overlay click
  toggleBtnClass: false, // { toggle: true, name: 'btn' } allow trigger button class name toggling
}

Methods

popup.onOpen = () => {
  // some callback
};
popup.onCLose = () => {
  // some callback
};
popup.openTarget(target) // open specific popup
popup.closeAll() // close all popups
popup.destroy() // close all popups and remomove listeners

Keywords

FAQs

Package last updated on 09 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc