Minimal Modal Popup For Inline Content – Modal.js

Category: Javascript , Modal & Popup | October 10, 2020
Author: idurar
Views Total: 146 views
Official Page: Go to website
Last Update: October 10, 2020
License: MIT

Preview:

Minimal Modal Popup For Inline Content – Modal.js

Description:

A minimal JavaScript library to show inline content in an animated, modal-style popup window.

How to use it:

1. Create the content for the modal and make it invisible on page load.

<div id="modalContent" style="display:none">
 <h2>Modal Title</h2>
 <p>Modal Content Here</p>
</div>

2. Load the modal.css and modal.js from the dist folder.

<link rel="stylesheet" href="src/modal.css" />
<script src="src/modal.js"></script>

3. Launch the modal window when needed.

modal.open('modalContent');

4. Close the modal window manually.

modal.close('modalContent');

You Might Be Interested In:


Leave a Reply