/javascript-modal

Javascript modal - tiny and simple.

Primary LanguageSCSSMIT LicenseMIT

Javascript Modal

Javascript modal - tiny and simple.

Status

JS gzip size JS Brotli size CSS gzip size CSS Brotli size

Javascript Modal

Options

Option Type Default Description Example
id string id DOM element Example
data-position string center special class can be added Example
data-size string small special class can be added Example
data-transition int 300ms opening and closing animation speed Example

Usage example

Script

var modal = new Modal;

View

<!-- Button trigger modal -->
<button 
    class="modalBtn"
    data-target="#modal-center"
>
Default
</button>

<!-- Modal -->
<div 
    class="modal-container" 
    id="modal-center"
    data-position="center"
    data-size="medium"
    data-transition="300"
    >
    <div class="modal-wrapper">
        <i class="modal-close"></i>
        ...
    </div>
</div>

Copyright and license

Designed and built by Kenan Gündoğan
2021 Currently - Code released under the MIT License Docs released under Creative Commons