1.1.1 • Published 3 years ago

awesomemodal v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

AwesomeModal

A vanilla, lightweight JavaScript plugin for creating custom modals. Live Demo click.

Installation

Use the package manager npm or yarn to install AwesomeModal.

npm install awesomemodal
yarn add awesomemodal

Usage

// Css
<link href="css/AwesomeModal.css" rel="stylesheet" type="text/css">

// JavaScript
import AwesomeModal

const myCustomModal = new AwesomeModal('.awesomeModal', {options})

Options, Methods, Events

Options

@string (default: empty) - { overlayClass: '.anyClass' } - adding new custom classes for overlay,
@string (default: 'rgba(0,0,0,.1)') - { overlayBackground: (color, image or gradient) } - changing overlay background,
@boolean (default: false) - { overlayCloseAbleDisabled: true/false } - defines whether the modal will be closed when the overlay is clicked,
@boolean (default: false) - { modalAnimateDisabled: true/false } - defines whether the modal will animate

Methods

instance.open(), instance.close()

Events

Note: add event listeners to modalElement, not overlay.

close - Event will fired right after modal closing
open - Event will fired right after modal opening

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

1.1.1

3 years ago

1.1.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago