0.1.1 • Published 4 years ago

m1k v0.1.1

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

m1k

Tiny vanilla js module for modal windows. JS size 1.5k minified, 756 bytes gziped.

  • No dependencies
  • A11Y
  • Tiny
  • Supports any modern browsers

Install


    npm install m1k --save // via npm
    yarn add m1k --save // via yarn

Example

<a href="#" id="some-link">Open popup</a>


<div class="modal" id="popup-example" aria-hidden="true">
    <div class="modal__content">
        <button class="modal-close" data-modal-close></button>

        Modal window content here.
        
    </div>
</div>
    let modal = new Modal('popup-example');
    document.getElementById('test-modal-link1').onclick = function() {
        modal.show();
        return false;
    }

Options

List of options with default values:

{
    single: false,    // Close other modal windows when open new window
    esc: true,        // Close window on esc
    click: true,      // Close window on click in back,
    // Callbacks:
    onShow: function() {}, 
    onHide: function() {},
    onBeforeHide: function() {return true}
}
0.1.1

4 years ago

0.1.0

4 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago