Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yurayarosh/popup-simple
Small JS plugin to handle popup
https://github.com/yurayarosh/popup-simple
Last synced: 20 days ago
JSON representation
Small JS plugin to handle popup
- Host: GitHub
- URL: https://github.com/yurayarosh/popup-simple
- Owner: yurayarosh
- Created: 2019-10-29T15:04:51.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T11:32:24.000Z (about 2 years ago)
- Last Synced: 2024-03-24T23:02:23.138Z (10 months ago)
- Language: JavaScript
- Homepage:
- Size: 141 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# popup-js
### Install
```html
npm i popup-simple
``````html
open popup
``````js
import Popup from 'popup-simple'const popup = new Popup()
popup.init()
```### Options
Standart options
```js
{
preventScroll: true, // add body overflow hidden
escapeHandler: true, // handle Esc button click
closeOnOverlayClick: true, // close on overlay click
toggleBtnClass: false, // type: String, if provided - button '--active' BEM modificator would be toggling.
}
```### Methods
```js
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
```